|
8 | 8 | RSpec.describe 'exercising a device provider' do |
9 | 9 | let(:common_args) { '--verbose --trace --strict=error --modulepath spec/fixtures' } |
10 | 10 | let(:default_type_values) do |
11 | | - 'string="meep" boolean=true integer=15 float=1.23 ensure=present variant_pattern=AE321EEF '\ |
12 | | - 'url="http://www.puppet.com" boolean_param=false integer_param=99 float_param=3.21 '\ |
13 | | - 'ensure_param=present variant_pattern_param=0xAE321EEF url_param="https://www.google.com"' |
| 11 | + 'string="meep" boolean=true integer=15 float=1.23 ensure=present variant_pattern=AE321EEF ' \ |
| 12 | + 'url="http://www.puppet.com" boolean_param=false integer_param=99 float_param=3.21 ' \ |
| 13 | + 'ensure_param=present variant_pattern_param=0xAE321EEF url_param="https://www.google.com"' |
14 | 14 | end |
15 | 15 |
|
16 | 16 | before(:all) do # rubocop:disable RSpec/BeforeAfterAll |
|
32 | 32 |
|
33 | 33 | it 'deals with canonicalized resources correctly' do |
34 | 34 | stdout_str, status = Open3.capture2e("puppet resource #{common_args} device_provider wibble ensure=present #{default_type_values}") |
35 | | - stdmatch = 'Error: /Device_provider\[wibble\]: Could not evaluate: device_provider\[wibble\]#get has not provided canonicalized values.\n'\ |
36 | | - 'Returned values: \{:name=>"wibble", :ensure=>"present", :string=>"sample", :string_ro=>"fixed"\}\n'\ |
| 35 | + stdmatch = 'Error: /Device_provider\[wibble\]: Could not evaluate: device_provider\[wibble\]#get has not provided canonicalized values.\n' \ |
| 36 | + 'Returned values: \{:name=>"wibble", :ensure=>"present", :string=>"sample", :string_ro=>"fixed"\}\n' \ |
37 | 37 | 'Canonicalized values: \{:name=>"wibble", :ensure=>"present", :string=>"changed", :string_ro=>"fixed"\}' |
38 | 38 | expect(stdout_str).to match(/#{stdmatch}/) |
39 | 39 | expect(status).not_to be_success |
|
45 | 45 |
|
46 | 46 | it 'deals with canonicalized resources correctly' do |
47 | 47 | stdout_str, status = Open3.capture2e("puppet resource #{common_args} device_provider wibble ensure=present #{default_type_values}") |
48 | | - stdmatch = 'Warning: device_provider\[wibble\]#get has not provided canonicalized values.\n'\ |
49 | | - 'Returned values: \{:name=>"wibble", :ensure=>"present", :string=>"sample", :string_ro=>"fixed"\}\n'\ |
| 48 | + stdmatch = 'Warning: device_provider\[wibble\]#get has not provided canonicalized values.\n' \ |
| 49 | + 'Returned values: \{:name=>"wibble", :ensure=>"present", :string=>"sample", :string_ro=>"fixed"\}\n' \ |
50 | 50 | 'Canonicalized values: \{:name=>"wibble", :ensure=>"present", :string=>"changed", :string_ro=>"fixed"\}' |
51 | 51 | expect(stdout_str).to match(/#{stdmatch}/) |
52 | 52 | expect(status).to be_success |
@@ -155,9 +155,9 @@ def is_device_apply_supported? |
155 | 155 | it 'applies the catalog successfully' do |
156 | 156 | Tempfile.create('fact_set') do |f| |
157 | 157 | f.write 'device_provider{ "foo":' \ |
158 | | - 'ensure => "present", boolean => true, integer => 15, float => 1.23, variant_pattern => "0x1234ABCD", '\ |
159 | | - 'url => "http://www.google.com", boolean_param => false, integer_param => 99, float_param => 3.21, '\ |
160 | | - 'ensure_param => "present", variant_pattern_param => "9A2222ED", url_param => "http://www.puppet.com" }' |
| 158 | + 'ensure => "present", boolean => true, integer => 15, float => 1.23, variant_pattern => "0x1234ABCD", ' \ |
| 159 | + 'url => "http://www.google.com", boolean_param => false, integer_param => 99, float_param => 3.21, ' \ |
| 160 | + 'ensure_param => "present", variant_pattern_param => "9A2222ED", url_param => "http://www.puppet.com" }' |
161 | 161 | f.close |
162 | 162 |
|
163 | 163 | stdout_str, _status = Open3.capture2e("puppet device #{common_args} --deviceconfig #{device_conf.path} --apply #{f.path}") |
|
0 commit comments