|
86 | 86 |
|
87 | 87 | it 'normally times out after 120 seconds' do
|
88 | 88 | cmd = '/bin/echo testing 1 2 3'
|
89 |
| - expect(Timeout).to receive(:timeout).with(120, Timeout::Error).and_raise(Timeout::Error) |
| 89 | + allow(Timeout).to receive(:timeout).with(120, Timeout::Error).and_raise(Timeout::Error) |
90 | 90 |
|
91 | 91 | expect { provider.run_command(cmd) }.to raise_error Puppet::Error, "Timed out waiting for 'app.example.com' to run keytool"
|
92 | 92 | end
|
|
108 | 108 |
|
109 | 109 | context 'when using the file based parameters for certificate and private_key' do
|
110 | 110 | # rubocop:disable RSpec/MultipleExpectations
|
| 111 | + # rubocop:disable RSpec/StubbedMock |
111 | 112 | it 'converts a certificate to a pkcs12 file' do
|
112 | 113 | allow(provider).to receive(:password).and_return(resource[:password])
|
113 | 114 | allow(File).to receive(:read).with(resource[:private_key]).and_return('private key')
|
|
121 | 122 | provider.to_pkcs12("#{temp_dir}testing.stuff")
|
122 | 123 | end
|
123 | 124 | # rubocop:enable RSpec/MultipleExpectations
|
| 125 | + # rubocop:enable RSpec/StubbedMock |
124 | 126 | end
|
125 | 127 |
|
126 | 128 | context 'when using content based parameters for certificate and private_key' do
|
|
132 | 134 | end
|
133 | 135 |
|
134 | 136 | # rubocop:disable RSpec/MultipleExpectations
|
| 137 | + # rubocop:disable RSpec/StubbedMock |
135 | 138 | it 'converts a certificate to a pkcs12 file' do
|
136 | 139 | allow(provider).to receive(:password).and_return(resource[:password])
|
137 | 140 | allow(File).to receive(:read).with('/tmp/testing.stuff').ordered.and_return('private key')
|
|
145 | 148 | provider.to_pkcs12("#{temp_dir}testing.stuff")
|
146 | 149 | end
|
147 | 150 | # rubocop:enable RSpec/MultipleExpectations
|
| 151 | + # rubocop:enable RSpec/StubbedMock |
148 | 152 | end
|
149 | 153 | end
|
150 | 154 |
|
|
0 commit comments