Skip to content

Commit 8aa0453

Browse files
committed
(antonlindstrom#21) Fix FormatStringToken in all tests
1 parent f53dd4b commit 8aa0453

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

spec/classes/powerdns_init_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
it { is_expected.to contain_package(authoritative_package_name).with('ensure' => 'installed') }
6666
it { is_expected.to contain_service(authoritative_service_name).with('ensure' => 'running') }
6767
it { is_expected.to contain_service(authoritative_service_name).with('enable' => 'true') }
68-
it { is_expected.to contain_service(authoritative_service_name).that_requires(format('Package[%s]', authoritative_package_name)) }
68+
it { is_expected.to contain_service(authoritative_service_name).that_requires(format('Package[%<package>s]', package: authoritative_package_name)) }
6969
end
7070

7171
context 'powerdns class with mysql backend' do
@@ -114,10 +114,10 @@
114114
it { is_expected.to contain_powerdns__config('gmysql-user').with('value' => 'foo') }
115115
it { is_expected.to contain_powerdns__config('launch').with('value' => 'gmysql') }
116116

117-
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-dbname-%s', authoritative_config)) }
118-
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-password-%s', authoritative_config)) }
119-
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-user-%s', authoritative_config)) }
120-
it { is_expected.to contain_file_line(format('powerdns-config-launch-%s', authoritative_config)) }
117+
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-dbname-%<config>s', config: authoritative_config)) }
118+
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-password-%<config>s', config: authoritative_config)) }
119+
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-user-%<config>s', config: authoritative_config)) }
120+
it { is_expected.to contain_file_line(format('powerdns-config-launch-%<config>s', config: authoritative_config)) }
121121
end
122122

123123
# Test the recursor
@@ -140,7 +140,7 @@
140140
it { is_expected.to contain_package(recursor_package_name).with('ensure' => 'installed') }
141141
it { is_expected.to contain_service(recursor_service_name).with('ensure' => 'running') }
142142
it { is_expected.to contain_service(recursor_service_name).with('enable' => 'true') }
143-
it { is_expected.to contain_service(recursor_service_name).that_requires(format('Package[%s]', recursor_package_name)) }
143+
it { is_expected.to contain_service(recursor_service_name).that_requires(format('Package[%<package>s]', package: recursor_package_name)) }
144144
end
145145

146146
# Test errors

spec/defines/powerdns_config_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
}
4545
end
4646

47-
it { is_expected.to contain_file_line(format('powerdns-config-foo-%s', authoritative_config)) }
48-
it { is_expected.to contain_file_line(format('powerdns-config-foo-%s', authoritative_config)).with_ensure('present') }
49-
it { is_expected.to contain_file_line(format('powerdns-config-foo-%s', authoritative_config)).with_path(authoritative_config) }
50-
it { is_expected.to contain_file_line(format('powerdns-config-foo-%s', authoritative_config)).with_line('foo=bar') }
51-
it { is_expected.to contain_file_line(format('powerdns-config-foo-%s', authoritative_config)).with_match('^foo=') }
52-
it { is_expected.to contain_file_line(format('powerdns-config-foo-%s', authoritative_config)).that_notifies(format('Service[%s]', authoritative_service_name)) }
47+
it { is_expected.to contain_file_line(format('powerdns-config-foo-%<config>s', config: authoritative_config)) }
48+
it { is_expected.to contain_file_line(format('powerdns-config-foo-%<config>s', config: authoritative_config)).with_ensure('present') }
49+
it { is_expected.to contain_file_line(format('powerdns-config-foo-%<config>s', config: authoritative_config)).with_path(authoritative_config) }
50+
it { is_expected.to contain_file_line(format('powerdns-config-foo-%<config>s', config: authoritative_config)).with_line('foo=bar') }
51+
it { is_expected.to contain_file_line(format('powerdns-config-foo-%<config>s', config: authoritative_config)).with_match('^foo=') }
52+
it { is_expected.to contain_file_line(format('powerdns-config-foo-%<config>s', config: authoritative_config)).that_notifies(format('Service[%<service>s]', service: authoritative_service_name)) }
5353
end
5454

5555
context 'powerdns::config with recursor type' do
@@ -61,7 +61,7 @@
6161
}
6262
end
6363

64-
it { is_expected.to contain_file_line(format('powerdns-config-foo-%s', recursor_config)) }
64+
it { is_expected.to contain_file_line(format('powerdns-config-foo-%<config>s', config: recursor_config)) }
6565
end
6666

6767
# Test for empty values
@@ -72,7 +72,7 @@
7272
}
7373
end
7474

75-
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-dnssec-%s', authoritative_config)) }
75+
it { is_expected.to contain_file_line(format('powerdns-config-gmysql-dnssec-%<config>s', config: authoritative_config)) }
7676
end
7777

7878
context 'powerdns::config with empty value for only-notify' do
@@ -82,7 +82,7 @@
8282
}
8383
end
8484

85-
it { is_expected.to contain_file_line(format('powerdns-config-only-notify-%s', authoritative_config)) }
85+
it { is_expected.to contain_file_line(format('powerdns-config-only-notify-%<config>s', config: authoritative_config)) }
8686
end
8787

8888
context 'powerdns::config with empty value' do

0 commit comments

Comments
 (0)