Skip to content

Commit

Permalink
Moved DeviceName tests from old to new testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Oct 20, 2015
1 parent 4ab984c commit 35e8d8b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 57 deletions.
22 changes: 22 additions & 0 deletions test/routines_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,25 @@ def initialize
expect(routines.ValidNicName("eth0?")).to be false
end
end

describe "#DeviceName" do
subject(:routines) { RoutinesTestClass.new }
let(:hwinfo) do
{
"sub_vendor" => "hw_vendor",
"sub_device" => "hw_device"
}
end

it "returns empty string when nothing is defined" do
expect(routines.DeviceName({})).to be_empty
end

it "returns description containing model name when known" do
expect(routines.DeviceName(hwinfo.merge("model" => "hw_model"))).to eql "hw_model"
end

it "returns description build from vendor and device details when model name is uknown" do
expect(routines.DeviceName(hwinfo)).to eql "hw_vendor hw_device"
end
end
Empty file removed testsuite/tests/hardware.err
Empty file.
4 changes: 0 additions & 4 deletions testsuite/tests/hardware.out

This file was deleted.

53 changes: 0 additions & 53 deletions testsuite/tests/hardware.rb

This file was deleted.

0 comments on commit 35e8d8b

Please sign in to comment.