Skip to content

Commit

Permalink
disable/fix rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 14, 2021
1 parent c29aafd commit 1946415
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions spec/functions/cert_aia_caissuers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'spec_helper'

# rubocop:disable RSpec/MessageSpies
describe 'cert_aia_caissuers' do
it { is_expected.not_to eq(nil) }

Expand Down
2 changes: 1 addition & 1 deletion spec/functions/cert_date_valid_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'

# rubocop:disable RSpec/MessageSpies
describe 'cert_date_valid' do
it { is_expected.not_to eq(nil) }

Expand Down
15 changes: 7 additions & 8 deletions spec/unit/puppet/provider/cert_file/posix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
require 'pathname'
require 'webmock/rspec'
require 'openssl'

describe 'The POSIX provider for type cert_file' do
before(:each) do
before do
test_keys = OpenSSL::PKey::RSA.new(2049)
test_cert = OpenSSL::X509::Certificate.new
test_cert.version = 2
Expand All @@ -16,19 +15,19 @@
test_cert.not_after = test_cert.not_before + 3600 # 1 hour
test_cert.sign(test_keys, OpenSSL::Digest::SHA256.new)

resp_header = { 'Content-Type': 'application/x-x509-ca-cert' }
stub_request(:get, 'http://example.org/cert.der')
.to_return(status: 200, body: test_cert.to_der, headers: resp_header)
stub_request(:get, 'http://example.org/cert.pem')
.to_return(status: 200, body: test_cert.to_pem, headers: resp_header)
resp_header = { 'Content-Type' => 'application/x-x509-ca-cert' }
stub_request(:get, 'http://example.org/cert.der').
to_return(status: 200, body: test_cert.to_der, headers: resp_header)
stub_request(:get, 'http://example.org/cert.pem').
to_return(status: 200, body: test_cert.to_pem, headers: resp_header)
end

let(:path) { '/tmp/test.pem' }
let(:source) { 'http://example.org/cert.der' }
let(:resource) { Puppet::Type::Cert_file.new(path: path, source: source) }

it 'exists? returns false on arbitraty path' do
allow_any_instance_of(Pathname).to receive(:exist?).and_return(false)
allow_any_instance_of(Pathname).to receive(:exist?).and_return(false) # rubocop:disable RSpec/AnyInstance
expect(resource.provider.exists?).to eq(false)
end

Expand Down
1 change: 1 addition & 0 deletions spec/unit/puppet/provider/dhparam/openssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'pathname'
require 'puppet/type/dhparam'

# rubocop:disable RSpec/MessageSpies
provider_class = Puppet::Type.type(:dhparam).provider(:openssl)
describe 'The openssl provider for the dhparam type' do
let(:path) { '/tmp/dhparam.pem' }
Expand Down
1 change: 1 addition & 0 deletions spec/unit/puppet/provider/ssl_pkey/openssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'pathname'
require 'puppet/type/ssl_pkey'

# rubocop:disable RSpec/MessageSpies
describe 'The openssl provider for the ssl_pkey type' do
let(:path) { '/tmp/foo.key' }
let(:pathname) { Pathname.new(path) }
Expand Down
1 change: 1 addition & 0 deletions spec/unit/puppet/provider/x509_cert/openssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'pathname'
require 'puppet/type/x509_cert'

# rubocop:disable RSpec/MessageSpies
provider_class = Puppet::Type.type(:x509_cert).provider(:openssl)
describe 'The openssl provider for the x509_cert type' do
let(:path) { '/tmp/foo.crt' }
Expand Down
1 change: 1 addition & 0 deletions spec/unit/puppet/provider/x509_request/openssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'pathname'
require 'puppet/type/x509_request'

# rubocop:disable RSpec/MessageSpies
provider_class = Puppet::Type.type(:x509_request).provider(:openssl)
describe 'The openssl provider for the x509_request type' do
let(:path) { '/tmp/foo.csr' }
Expand Down

0 comments on commit 1946415

Please sign in to comment.