Skip to content

Commit ec47563

Browse files
committed
rubocop: autofix
1 parent 8c963ad commit ec47563

21 files changed

Lines changed: 55 additions & 73 deletions

File tree

lib/facter/framework/cli/cli.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ def add_commands_to_help
201201
Cli.commands.values
202202
.select { |command_class| command_class.instance_of?(Thor::Command) }
203203
.each do |command|
204-
help_command_options << build_option(
205-
command['name'],
206-
[command['usage'].split(',')[1]],
207-
command['description']
208-
)
204+
help_command_options << build_option(
205+
command['name'],
206+
[command['usage'].split(',')[1]],
207+
command['description']
208+
)
209209
end
210210

211211
help_command_options

lib/facter/resolvers/linux/processors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def physical_devices_count
7070
.select { |dir| dir =~ /cpu[0-9]+$/ }
7171
.select { |dir| File.exist?("/sys/devices/system/cpu/#{dir}/topology/physical_package_id") }
7272
.map do |dir|
73-
Facter::Util::FileHelper.safe_read("/sys/devices/system/cpu/#{dir}/topology/physical_package_id").strip
73+
Facter::Util::FileHelper.safe_read("/sys/devices/system/cpu/#{dir}/topology/physical_package_id").strip
7474
end
7575
.uniq.count
7676
end

spec/custom_facts/core/aggregate_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
let(:logger) { Facter::Log.class_variable_get(:@@logger) }
88

99
it 'can be resolved' do
10-
expect(aggregate_res).to be_a_kind_of LegacyFacter::Core::Resolvable
10+
expect(aggregate_res).to be_a LegacyFacter::Core::Resolvable
1111
end
1212

1313
it 'can be confined and weighted' do
14-
expect(aggregate_res).to be_a_kind_of LegacyFacter::Core::Suitable
14+
expect(aggregate_res).to be_a LegacyFacter::Core::Suitable
1515
end
1616

1717
it 'can be compared' do
@@ -92,7 +92,7 @@
9292
end
9393

9494
output = aggregate_res.value
95-
expect(output).to match_array(['foo', 'foo bar'])
95+
expect(output).to contain_exactly('foo', 'foo bar')
9696
end
9797

9898
it 'clones and freezes chunk results' do

spec/custom_facts/util/collection_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def load(collection)
268268
it 'does not include facts that did not return a value' do
269269
collection.add(:two, value: nil)
270270

271-
expect(collection.to_hash).not_to be_include(:two)
271+
expect(collection.to_hash).not_to include(:two)
272272
end
273273
end
274274

@@ -299,7 +299,7 @@ def load(collection)
299299
facts[fact] = value
300300
end
301301

302-
expect(facts).not_to be_include('nil_fact')
302+
expect(facts).not_to include('nil_fact')
303303
end
304304
end
305305

spec/custom_facts/util/fact_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@
9494

9595
it 'creates a simple resolution when the type is nil' do
9696
fact.define_resolution('named')
97-
expect(fact.resolution('named')).to be_a_kind_of Facter::Util::Resolution
97+
expect(fact.resolution('named')).to be_a Facter::Util::Resolution
9898
end
9999

100100
it 'creates a simple resolution when the type is :simple' do
101101
fact.define_resolution('named', type: :simple)
102-
expect(fact.resolution('named')).to be_a_kind_of Facter::Util::Resolution
102+
expect(fact.resolution('named')).to be_a Facter::Util::Resolution
103103
end
104104

105105
it 'creates an aggregate resolution when the type is :aggregate' do
106106
fact.define_resolution('named', type: :aggregate)
107-
expect(fact.resolution('named')).to be_a_kind_of Facter::Core::Aggregate
107+
expect(fact.resolution('named')).to be_a Facter::Core::Aggregate
108108
end
109109

110110
it 'raises an error if there is an existing resolution with a different type' do

spec/custom_facts/util/loader_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def loader_from(places)
7272
allow(File).to receive(:directory?).with('/two').and_return false
7373

7474
paths = loader.search_path
75-
expect(paths).to match_array(['/one'])
75+
expect(paths).to contain_exactly('/one')
7676
end
7777

7878
describe 'and the FACTERLIB environment variable is set' do

spec/custom_facts/util/resolution_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
describe 'when setting the code' do
3232
it 'creates a block when given a command' do
3333
resolution.setcode 'foo'
34-
expect(resolution.code).to be_a_kind_of Proc
34+
expect(resolution.code).to be_a Proc
3535
end
3636

3737
it 'stores the provided block when given a block' do

spec/facter/facts/debian/os/release_spec.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@
66

77
shared_examples 'returns os release fact' do
88
it 'returns os release fact' do
9-
expect(fact.call_the_resolver).to match_array \
10-
[
11-
having_attributes(name: 'os.release', value: fact_value),
12-
having_attributes(name: 'operatingsystemmajrelease', value: fact_value['major'],
13-
type: :legacy),
14-
having_attributes(name: 'operatingsystemrelease', value: fact_value['full'],
15-
type: :legacy)
16-
]
9+
expect(fact.call_the_resolver).to contain_exactly(having_attributes(name: 'os.release', value: fact_value), having_attributes(name: 'operatingsystemmajrelease', value: fact_value['major'],
10+
type: :legacy), having_attributes(name: 'operatingsystemrelease', value: fact_value['full'],
11+
type: :legacy))
1712
end
1813
end
1914

spec/facter/facts/linux/kernelversion_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
end
1818

1919
describe '#call_the_resolver' do
20-
context 'when full version includes ' do
20+
context 'when full version includes' do
2121
let(:resolver_value) { '4.11.5-19-generic' }
2222
let(:fact_value) { '4.11.5' }
2323

spec/facter/facts/solaris/ldom_spec.rb

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,8 @@
4242
end
4343

4444
it 'returns virtual fact as ldom' do
45-
expect(fact.call_the_resolver).to match_array(
46-
[
47-
an_object_having_attributes(name: 'ldom', value: value, type: :core),
48-
an_object_having_attributes(name: 'ldom_domainchassis', value: 'AK00358110', type: :legacy),
49-
an_object_having_attributes(name: 'ldom_domaincontrol', value: 'opdx-a0-sun2', type: :legacy),
50-
an_object_having_attributes(name: 'ldom_domainname', value: 'sol11-9', type: :legacy),
51-
an_object_having_attributes(name: 'ldom_domainrole_control', value: 'false', type: :legacy),
52-
an_object_having_attributes(name: 'ldom_domainrole_impl', value: 'LDoms', type: :legacy),
53-
an_object_having_attributes(name: 'ldom_domainrole_io', value: 'false', type: :legacy),
54-
an_object_having_attributes(name: 'ldom_domainrole_root', value: 'false', type: :legacy),
55-
an_object_having_attributes(name: 'ldom_domainrole_service', value: 'false', type: :legacy),
56-
an_object_having_attributes(name: 'ldom_domainuuid', value: 'd7a3a4df-ce8c-47a9-b396-cb5a5f30c0b2',
57-
type: :legacy)
58-
]
59-
)
45+
expect(fact.call_the_resolver).to contain_exactly(an_object_having_attributes(name: 'ldom', value: value, type: :core), an_object_having_attributes(name: 'ldom_domainchassis', value: 'AK00358110', type: :legacy), an_object_having_attributes(name: 'ldom_domaincontrol', value: 'opdx-a0-sun2', type: :legacy), an_object_having_attributes(name: 'ldom_domainname', value: 'sol11-9', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_control', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_impl', value: 'LDoms', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_io', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_root', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainrole_service', value: 'false', type: :legacy), an_object_having_attributes(name: 'ldom_domainuuid', value: 'd7a3a4df-ce8c-47a9-b396-cb5a5f30c0b2',
46+
type: :legacy))
6047
end
6148
end
6249

0 commit comments

Comments
 (0)