Skip to content

Commit 2637a77

Browse files
authored
Merge branch 'main' into pdksync_CONT-1028-update-stdlib-dependency
2 parents 7bfda16 + 420e082 commit 2637a77

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

spec/classes/compose_spec.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@
7373
params
7474
end
7575

76-
if params['proxy'] != :undef && !%r{^((https?)?://)?([^:^@]+:[^:^@]+@|)([\da-z.-]+)\.([\da-z.]{2,6})(:\d)?([/\w .-]*)*/?$}.match?(params['proxy'])
77-
it {
78-
expect(subject).to compile.and_raise_error(%r{parameter 'proxy' expects an undef value or a match for Pattern})
79-
}
80-
81-
next
76+
if title == 'when proxy is not a http proxy'
77+
it 'raises an error for invalid proxy URL' do
78+
expect(subject).to compile.and_raise_error(
79+
%r{parameter 'proxy' expects an undef value or a match for Pattern},
80+
)
81+
end
82+
else
83+
include_examples 'compose', params, facts
8284
end
83-
84-
include_examples 'compose', params, facts
8585
end
8686
end
8787
end

spec/classes/machine_spec.rb

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require 'spec_helper'
4-
4+
# Need to write test casees here
55
tests = {
66
'with default value' => {}
77
}
@@ -42,14 +42,17 @@
4242
params
4343
end
4444

45-
if params['proxy'] != :undef && !'^((http[s]?)?:\/\/)?([^:^@]+:[^:^@]+@|)([\da-z\.-]+)\.([\da-z\.]{2,6})(:[\d])?([\/\w \.-]*)*\/?$'.match?(params['proxy'])
46-
it {
47-
expect(subject).to compile.and_raise_error(%r{})
48-
}
49-
50-
next
51-
end
52-
45+
# Need to write check condition for params['proxy']
46+
# The block commented below currently has no test case, if in future more test cases are added to this spec file, please refer to spec/classes/compose_spec.rb and implement as required here.
47+
# if title == 'when proxy is not a http proxy'
48+
# it 'raises an error for invalid proxy URL' do
49+
# is_expected.to compile.and_raise_error(
50+
# %r{parameter 'proxy' expects an undef value or a match for Pattern},
51+
# )
52+
# end
53+
# else
54+
# include_examples 'machine', params, facts, defaults
55+
# end
5356
include_examples 'machine', params, facts, defaults
5457
end
5558
end

0 commit comments

Comments
 (0)