Skip to content

Commit

Permalink
Convert specs to RSpec 3.1.7 syntax with Transpec
Browse files Browse the repository at this point in the history
This conversion is done by Transpec 3.1.1 with the following command:
    transpec --keep oneliner

* 65 conversions
    from: obj.should
      to: expect(obj).to

* 23 conversions
    from: == expected
      to: eq(expected)

For more details: https://github.com/yujinakayama/transpec#supported-conversions
  • Loading branch information
jhoblitt committed Nov 24, 2015
1 parent 5c0628b commit 97ddb33
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 65 deletions.
6 changes: 3 additions & 3 deletions spec/unit/facts/megacli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter::Util::Resolution.stubs(:which).with('MegaCli').returns(nil)
Facter::Util::Resolution.stubs(:which).with('megacli').returns(nil)
Facter.fact(:megacli).value.should be_nil
expect(Facter.fact(:megacli).value).to be_nil
end
end

context 'in path mixed case' do
it do
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter::Util::Resolution.stubs(:which).with('MegaCli').returns('/usr/bin/MegaCli')
Facter.fact(:megacli).value.should == '/usr/bin/MegaCli'
expect(Facter.fact(:megacli).value).to eq('/usr/bin/MegaCli')
end
end

Expand All @@ -26,7 +26,7 @@
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter::Util::Resolution.stubs(:which).with('MegaCli').returns(nil)
Facter::Util::Resolution.stubs(:which).with('megacli').returns('/usr/bin/megacli')
Facter.fact(:megacli).value.should == '/usr/bin/megacli'
expect(Facter.fact(:megacli).value).to eq('/usr/bin/megacli')
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/facts/megacli_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
context 'megacli fact not set' do
it 'should return nil' do
Facter.fact(:megacli).stubs(:value).returns(nil)
Facter.fact(:megacli_version).value.should be_nil
expect(Facter.fact(:megacli_version).value).to be_nil
end
end

context 'megacli fact is broken' do
it 'should return nil' do
Facter.fact(:megacli).stubs(:value).returns('foobar')
Facter.fact(:megacli_version).value.should be_nil
expect(Facter.fact(:megacli_version).value).to be_nil
end
end

Expand All @@ -23,7 +23,7 @@
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Cli -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-cli-aall-8.07.07')))
Facter.fact(:megacli_version).value.should == '8.07.07'
expect(Facter.fact(:megacli_version).value).to eq('8.07.07')
end

it 'should get the version string using legacy binary' do
Expand All @@ -34,7 +34,7 @@
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -v -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-aall-8.00.11')))
Facter.fact(:megacli_version).value.should == '8.00.11'
expect(Facter.fact(:megacli_version).value).to eq('8.00.11')
end
end

Expand Down
10 changes: 5 additions & 5 deletions spec/unit/facts/megaraid_adapters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter.fact(:megacli).stubs(:value).returns(nil)

Facter.fact(:megaraid_adapters).value.should be_nil
expect(Facter.fact(:megaraid_adapters).value).to be_nil
end
end

Expand All @@ -20,7 +20,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -adpCount -NoLog 2>&1').
returns(nil)

Facter.fact(:megaraid_adapters).value.should == '0'
expect(Facter.fact(:megaraid_adapters).value).to eq('0')
end
end

Expand All @@ -31,7 +31,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -adpCount -NoLog 2>&1').
returns(File.read(fixtures('megacli', 'adpcount-count_0')))

Facter.fact(:megaraid_adapters).value.should == '0'
expect(Facter.fact(:megaraid_adapters).value).to eq('0')
end

it 'should find 1 adapters' do
Expand All @@ -40,7 +40,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -adpCount -NoLog 2>&1').
returns(File.read(fixtures('megacli', 'adpcount-count_1')))

Facter.fact(:megaraid_adapters).value.should == '1'
expect(Facter.fact(:megaraid_adapters).value).to eq('1')
end
end
end # on linux
Expand All @@ -49,7 +49,7 @@
it do
Facter.fact(:kernel).stubs(:value).returns('Solaris')

Facter.fact(:megaraid_adapters).value.should be_nil
expect(Facter.fact(:megaraid_adapters).value).to be_nil
end
end # not on linux

Expand Down
8 changes: 4 additions & 4 deletions spec/unit/facts/megaraid_fw_package_build_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
context 'megacli fact not set' do
it 'should return nil' do
Facter.fact(:megacli).stubs(:value).returns(nil)
Facter.fact(:megaraid_fw_package_build).value.should be_nil
expect(Facter.fact(:megaraid_fw_package_build).value).to be_nil
end
end

context 'megacli fact is broken' do
it 'should return nil' do
Facter.fact(:megacli).stubs(:value).returns('foobar')
Facter.fact(:megaraid_fw_package_build).value.should be_nil
expect(Facter.fact(:megaraid_fw_package_build).value).to be_nil
end
end

Expand All @@ -25,7 +25,7 @@
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Ctrl -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-ctrl-aall-8.07.07')))
Facter.fact(:megaraid_fw_package_build).value.should == '23.22.0-0012'
expect(Facter.fact(:megaraid_fw_package_build).value).to eq('23.22.0-0012')
end
end

Expand All @@ -36,7 +36,7 @@
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -AdpAllInfo -aALL -NoLog').
returns(File.read(fixtures('megacli', 'adpallinfo-aall-8.00.11')))
Facter.fact(:megaraid_fw_package_build).value.should == '20.12.0-0004'
expect(Facter.fact(:megaraid_fw_package_build).value).to eq('20.12.0-0004')
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/facts/megaraid_fw_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
context 'megacli fact not set' do
it 'should return nil' do
Facter.fact(:megacli).stubs(:value).returns(nil)
Facter.fact(:megaraid_fw_version).value.should be_nil
expect(Facter.fact(:megaraid_fw_version).value).to be_nil
end
end

context 'megacli fact is broken' do
it 'should return nil' do
Facter.fact(:megacli).stubs(:value).returns('foobar')
Facter.fact(:megaraid_fw_version).value.should be_nil
expect(Facter.fact(:megaraid_fw_version).value).to be_nil
end
end

Expand All @@ -25,7 +25,7 @@
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -Version -Ctrl -aALL -NoLog').
returns(File.read(fixtures('megacli', 'version-ctrl-aall-8.07.07')))
Facter.fact(:megaraid_fw_version).value.should == '3.340.05-2939'
expect(Facter.fact(:megaraid_fw_version).value).to eq('3.340.05-2939')
end
end

Expand All @@ -36,7 +36,7 @@
Facter::Util::Resolution.stubs(:exec).
with('/usr/bin/MegaCli -AdpAllInfo -aALL -NoLog').
returns(File.read(fixtures('megacli', 'adpallinfo-aall-8.00.11')))
Facter.fact(:megaraid_fw_version).value.should == '2.120.14-2138'
expect(Facter.fact(:megaraid_fw_version).value).to eq('2.120.14-2138')
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions spec/unit/facts/megaraid_physical_drives_sas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter.fact(:megacli).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives_sas).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sas).value).to be_nil
end
end

Expand All @@ -19,7 +19,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives_sas).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sas).value).to be_nil
end

it do
Expand All @@ -29,7 +29,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -PDList -aALL -NoLog').
returns(nil)

Facter.fact(:megaraid_physical_drives_sas).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sas).value).to be_nil
end
end

Expand All @@ -39,7 +39,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns('0')

Facter.fact(:megaraid_physical_drives_sas).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sas).value).to be_nil
end
end

Expand All @@ -51,7 +51,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -PDList -aALL -NoLog').
returns(File.read(fixtures('megacli', 'pdlistaall')))

Facter.fact(:megaraid_physical_drives_sas).value.should == '188,189,190,192,194,197,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214'
expect(Facter.fact(:megaraid_physical_drives_sas).value).to eq('188,189,190,192,194,197,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214')
end
end
end # on linux
Expand All @@ -60,7 +60,7 @@
it do
Facter.fact(:kernel).stubs(:value).returns('Solaris')

Facter.fact(:megaraid_physical_drives_sas).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sas).value).to be_nil
end
end # not on linux
end
12 changes: 6 additions & 6 deletions spec/unit/facts/megaraid_physical_drives_sata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter.fact(:megacli).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives_sata).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sata).value).to be_nil
end
end

Expand All @@ -19,7 +19,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives_sata).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sata).value).to be_nil
end

it do
Expand All @@ -29,7 +29,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -PDList -aALL -NoLog').
returns(nil)

Facter.fact(:megaraid_physical_drives_sata).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sata).value).to be_nil
end
end

Expand All @@ -39,7 +39,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns('0')

Facter.fact(:megaraid_physical_drives_sata).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sata).value).to be_nil
end
end

Expand All @@ -51,7 +51,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -PDList -aALL -NoLog').
returns(File.read(fixtures('megacli', 'pdlistaall')))

Facter.fact(:megaraid_physical_drives_sata).value.should == '10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,184,185'
expect(Facter.fact(:megaraid_physical_drives_sata).value).to eq('10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,184,185')
end
end
end # on linux
Expand All @@ -60,7 +60,7 @@
it do
Facter.fact(:kernel).stubs(:value).returns('Solaris')

Facter.fact(:megaraid_physical_drives_sata).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_sata).value).to be_nil
end
end # not on linux
end
12 changes: 6 additions & 6 deletions spec/unit/facts/megaraid_physical_drives_size_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter.fact(:megacli).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives_size).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_size).value).to be_nil
end
end

Expand All @@ -19,7 +19,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives_size).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_size).value).to be_nil
end

it do
Expand All @@ -29,7 +29,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -PDList -aALL -NoLog').
returns(nil)

Facter.fact(:megaraid_physical_drives_size).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_size).value).to be_nil
end
end

Expand All @@ -39,7 +39,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns('0')

Facter.fact(:megaraid_physical_drives_size).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_size).value).to be_nil
end
end

Expand All @@ -62,7 +62,7 @@
'3.638 TB,3.638 TB,3.638 TB,3.638 TB,3.638 TB,3.638 TB,' +
'3.638 TB,3.638 TB,3.638 TB,3.638 TB,3.638 TB,3.638 TB,' +
'3.638 TB,3.638 TB,3.638 TB,3.638 TB,3.638 TB,3.638 TB'
Facter.fact(:megaraid_physical_drives_size).value.should == sizes
expect(Facter.fact(:megaraid_physical_drives_size).value).to eq(sizes)
end
end
end # on linux
Expand All @@ -71,7 +71,7 @@
it do
Facter.fact(:kernel).stubs(:value).returns('Solaris')

Facter.fact(:megaraid_physical_drives_size).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives_size).value).to be_nil
end
end # not on linux
end
12 changes: 6 additions & 6 deletions spec/unit/facts/megaraid_physical_drives_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Facter.fact(:kernel).stubs(:value).returns('Linux')
Facter.fact(:megacli).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives).value).to be_nil
end
end

Expand All @@ -19,7 +19,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns(nil)

Facter.fact(:megaraid_physical_drives).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives).value).to be_nil
end

it do
Expand All @@ -29,7 +29,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -PDList -aALL -NoLog').
returns(nil)

Facter.fact(:megaraid_physical_drives).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives).value).to be_nil
end
end

Expand All @@ -39,7 +39,7 @@
Facter.fact(:megacli).stubs(:value).returns('/usr/bin/MegaCli')
Facter.fact(:megaraid_adapters).stubs(:value).returns('0')

Facter.fact(:megaraid_physical_drives).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives).value).to be_nil
end
end

Expand All @@ -51,7 +51,7 @@
Facter::Util::Resolution.stubs(:exec).with('/usr/bin/MegaCli -PDList -aALL -NoLog').
returns(File.read(fixtures('megacli', 'pdlistaall')))

Facter.fact(:megaraid_physical_drives).value.should == '10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,184,185,188,189,190,192,194,197,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214'
expect(Facter.fact(:megaraid_physical_drives).value).to eq('10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,184,185,188,189,190,192,194,197,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214')
end
end
end # on linux
Expand All @@ -60,7 +60,7 @@
it do
Facter.fact(:kernel).stubs(:value).returns('Solaris')

Facter.fact(:megaraid_physical_drives).value.should be_nil
expect(Facter.fact(:megaraid_physical_drives).value).to be_nil
end
end # not on linux
end
Loading

0 comments on commit 97ddb33

Please sign in to comment.