Skip to content

Commit

Permalink
Removed unnecessary comments and refactored Functional test
Browse files Browse the repository at this point in the history
Signed-off-by: John McCrae <[email protected]>
  • Loading branch information
johnmccrae committed Nov 30, 2021
1 parent 1e84d69 commit bf4ae54
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ source "https://rubygems.org"
# Specify your gem's dependencies in win32-certstore.gemspec
gemspec

# gem "mixlib-shellout", "< 3.2.3"

if Gem.ruby_version.to_s.start_with?("2.5")
# 16.7.23 required ruby 2.6+
gem "chef-utils", "< 16.7.23" # TODO: remove when we drop ruby 2.5
Expand Down
11 changes: 2 additions & 9 deletions spec/win32/functional/win32/certstore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
describe "#get" do
before { add_cert }
let(:cert_pem) { File.read('.\spec\win32\assets\GlobalSignRootCA.pem') }
before(:each) do
allow_any_instance_of(certbase).to receive(:get_cert_pem).and_return(cert_pem)
end
# passing valid thumbprint
it "returns the certificate_object if found" do
thumbprint = "b1bc968bd4f49d622aa89a81f2150152a41d829c"
Expand All @@ -52,12 +49,8 @@

# passing invalid thumbprint
it "returns raises an Arugment error" do
thumbprint = "b1bc968bd4f49d622aa89a81f2150152a41d829cab"
# cert_obj = @store.get(thumbprint)
# expect(cert_obj).to raise_error(ArgumentError)
# expect { @store.get(thumbprint) }.to raise_error(ArgumentError)
expect(@store).to receive(:cert_get).with(thumbprint).and_return("foo")
@store.get!(thumbprint)
thumbprint14 = "b1bc968bd4f49d622aa89a81f2150"
expect { @store.get(thumbprint14) }.to raise_error(ArgumentError)
end
end

Expand Down
1 change: 0 additions & 1 deletion win32-certstore.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler"
spec.add_development_dependency "rspec", "~> 3.0"

# spec.add_dependency "mixlib-shellout"
spec.add_dependency "ffi"
spec.add_runtime_dependency "chef-powershell"
spec.metadata["yard.run"] = "yri"
Expand Down

0 comments on commit bf4ae54

Please sign in to comment.