Skip to content

Commit f68a3ef

Browse files
committed
chore: replace verify_contents() from puppetlabs_spec_helper
1 parent 305f466 commit f68a3ef

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

spec/defines/resource_geo_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
title: 'should set address',
5454
attr: 'address',
5555
value: '$remote_addr',
56-
match: 'geo $remote_addr $client_network {'
56+
match: 'geo \$remote_addr \$client_network {'
5757
},
5858
{
5959
title: 'should set ranges',
@@ -109,7 +109,9 @@
109109
it { is_expected.to contain_file("/etc/nginx/conf.d/#{title}-geo.conf").with_mode('0644') }
110110

111111
it param[:title] do
112-
verify_contents(catalogue, "/etc/nginx/conf.d/#{title}-geo.conf", Array(param[:match]))
112+
Array(param[:match]).each do |match_item|
113+
is_expected.to contain_file("/etc/nginx/conf.d/#{title}-geo.conf").with_content(Regexp.new(match_item))
114+
end
113115
Array(param[:notmatch]).each do |item|
114116
is_expected.to contain_file("/etc/nginx/conf.d/#{title}-geo.conf").without_content(item)
115117
end

spec/defines/resource_map_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@
136136
it { is_expected.to contain_file("/etc/nginx/conf.d/#{title}-map.conf").with_mode('0644') }
137137

138138
it param[:title] do
139-
verify_contents(catalogue, "/etc/nginx/conf.d/#{title}-map.conf", Array(param[:match]))
139+
Array(param[:match]).each do |match_item|
140+
is_expected.to contain_file("/etc/nginx/conf.d/#{title}-map.conf").with_content(Regexp.new(match_item))
141+
end
140142
Array(param[:notmatch]).each do |item|
141143
is_expected.to contain_file("/etc/nginx/conf.d/#{title}-map.conf").without_content(item)
142144
end

0 commit comments

Comments
 (0)