Skip to content

Commit

Permalink
Switch from allow to expect
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 18, 2024
1 parent 7345df9 commit 35160e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/unit/puppet/provider/ssl_pkey/openssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
it 'creates with given password' do
resource[:password] = '2x$5{'
allow(OpenSSL::PKey::RSA).to receive(:new).with(2048).and_return(key)
allow(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(File).to receive(:write).with('/tmp/foo.key', kind_of(String))
resource.provider.create
end
Expand Down Expand Up @@ -72,7 +72,7 @@
resource[:authentication] = :rsa
resource[:password] = '2x$5{'
allow(OpenSSL::PKey::RSA).to receive(:new).with(2048).and_return(key)
allow(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(File).to receive(:write).with('/tmp/foo.key', kind_of(String))
resource.provider.create
end
Expand Down Expand Up @@ -102,7 +102,7 @@
resource[:authentication] = :dsa
resource[:password] = '2x$5{'
allow(OpenSSL::PKey::DSA).to receive(:new).with(2048).and_return(key)
allow(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(File).to receive(:write).with('/tmp/foo.key', kind_of(String))
resource.provider.create
end
Expand Down Expand Up @@ -134,7 +134,7 @@
resource[:authentication] = :ec
resource[:password] = '2x$5{'
allow(OpenSSL::PKey::EC).to receive(:new).with('secp384r1').and_return(key)
allow(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(OpenSSL::Cipher).to receive(:new).with('aes-256-cbc')
expect(File).to receive(:write).with('/tmp/foo.key', kind_of(String))
resource.provider.create
end
Expand Down

0 comments on commit 35160e1

Please sign in to comment.