|
439 | 439 | mof_is_embedded: false |
440 | 440 | }, |
441 | 441 | dsc_psdscrunascredential: { |
442 | | - type: 'Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]', |
| 442 | + type: 'Optional[Struct[{ user => String[1], password => Variant[String[1], Sensitive[String[1]]] }]]', |
443 | 443 | behaviour: :parameter, |
444 | 444 | mandatory_for_get: false, |
445 | 445 | mandatory_for_set: false, |
|
886 | 886 | mof_is_embedded: false |
887 | 887 | }, |
888 | 888 | dsc_psdscrunascredential: { |
889 | | - type: 'Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]', |
| 889 | + type: 'Optional[Struct[{ user => String[1], password => Variant[String[1], Sensitive[String[1]]] }]]', |
890 | 890 | desc: 'The Credential to run DSC under', |
891 | 891 | behaviour: :parameter, |
892 | 892 | mandatory_for_get: false, |
|
1552 | 1552 | let(:test_resource) { base_resource.merge(additional_parameters) } |
1553 | 1553 |
|
1554 | 1554 | before do |
| 1555 | + allow(Puppet::Pops::Types::PSensitiveType::Sensitive).to receive(:===).with(foo_password).and_return(true) |
| 1556 | + allow(Puppet::Pops::Types::PSensitiveType::Sensitive).to receive(:===).with(bar_password).and_return(true) |
1555 | 1557 | allow(foo_password).to receive(:unwrap).and_return('foo') |
1556 | 1558 | allow(bar_password).to receive(:unwrap).and_return('bar') |
1557 | 1559 | end |
|
1790 | 1792 | let(:variable_interpolated_param_hash) do |
1791 | 1793 | "$InvokeParams = @{Name = 'Foo'; Method = 'Get'; Property = @{credential = $SomeCredential}; ModuleName = 'PuppetDsc'}" |
1792 | 1794 | end |
1793 | | - |
| 1795 | + before do |
| 1796 | + allow(Puppet::Pops::Types::PSensitiveType::Sensitive).to receive(:===).with(password).and_return(true) |
| 1797 | + allow(password).to receive(:unwrap).and_return('bar') |
| 1798 | + end |
1794 | 1799 | it 'unwraps the credential hash and interpolates the appropriate variable' do |
1795 | 1800 | expect(password).to receive(:unwrap).and_return('FooPassword') |
1796 | 1801 | expect(provider).to receive(:interpolate_variables).with(formatted_param_hash).and_return(variable_interpolated_param_hash) |
|
0 commit comments