Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
(FACT-2589) fix RSpec warnings (#490)
Browse files Browse the repository at this point in the history
* (FACT-2589) fix RSpec warnings
* (FACT-2589) remove empty before hook
  • Loading branch information
Gheorghe Popescu committed May 6, 2020
1 parent 7ca2e67 commit 051bfa7
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spec/custom_facts/core/aggregate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end

it 'fact_type does not raise error' do
expect { aggregate_res.options(fact_type: 'custom') }.not_to raise_error(ArgumentError)
expect { aggregate_res.options(fact_type: 'custom') }.not_to raise_error
end
end

Expand Down
7 changes: 3 additions & 4 deletions spec/custom_facts/util/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
shared_examples_for 'handling a not readable file' do
before do
allow(Facter::Util::FileHelper).to receive(:safe_read).with(data_file, nil).and_return(nil)
allow(LegacyFacter).to receive(:warn).at_least(:one)
allow(Facter).to receive(:log_exception).at_least(:once)
end

it 'handles not readable file' do
Expand All @@ -72,11 +72,10 @@
expect(LegacyFacter::Util::Parser.parser_for(data_file).results).to eq data
end

it 'handles exceptions and warn' do
# YAML data with an error
it 'handles exceptions' do
allow(Facter::Util::FileHelper).to receive(:safe_read)
.with(data_file, nil).and_return(data_in_yaml + '}')
allow(LegacyFacter).to receive(:warn).at_least(:one)
allow(Facter).to receive(:log_exception).at_least(:once)

expect { LegacyFacter::Util::Parser.parser_for(data_file).results }.not_to raise_error
end
Expand Down
2 changes: 1 addition & 1 deletion spec/custom_facts/util/resolution_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
end

it 'fact_type does not raise error' do
expect { resolution.options(fact_type: 'simple') }.not_to raise_error(ArgumentError)
expect { resolution.options(fact_type: 'simple') }.not_to raise_error
end

it 'fails on unhandled options' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
.and_return(true)
allow(Open3).to receive(:capture2)
.with('/bin/zonename')
.ordered
.and_return([zone_name_output, status])
end

Expand Down
1 change: 0 additions & 1 deletion spec/facter/resolvers/solaris/zfs_resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
status = double(Process::Status, to_s: st)
allow(Open3).to receive(:capture2)
.with('zfs upgrade -v')
.ordered
.and_return([output, status])
end

Expand Down
1 change: 0 additions & 1 deletion spec/facter/resolvers/solaris/zone_resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
.and_return(true)
allow(Open3).to receive(:capture2)
.with('/usr/sbin/zoneadm list -cp')
.ordered
.and_return([output, status])
end

Expand Down
1 change: 0 additions & 1 deletion spec/facter/resolvers/solaris/zpool_resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
status = double(Process::Status, to_s: st)
allow(Open3).to receive(:capture2)
.with('zpool upgrade -v')
.ordered
.and_return([output, status])
end

Expand Down

0 comments on commit 051bfa7

Please sign in to comment.