spec/mountable_spec.rb in linux_admin-0.7.0 vs spec/mountable_spec.rb in linux_admin-0.8.0
- old
+ new
@@ -25,45 +25,45 @@
eos
end
describe "#mount_point_exists?" do
it "uses mount" do
- TestMountable.should_receive(:run!).with(TestMountable.cmd(:mount)).and_return(CommandResult.new("", "", "", 0))
+ TestMountable.should_receive(:run!).with(TestMountable.cmd(:mount)).and_return(double(:output => ""))
TestMountable.mount_point_exists?('/mnt/usb')
end
context "disk mounted at specified location" do
it "returns true" do
- TestMountable.should_receive(:run!).and_return(CommandResult.new("", @mount_out1, "", 0))
+ TestMountable.should_receive(:run!).and_return(double(:output => @mount_out1))
TestMountable.mount_point_exists?('/mnt/usb').should be_true
end
end
context "no disk mounted at specified location" do
it "returns false" do
- TestMountable.should_receive(:run!).and_return(CommandResult.new("", @mount_out2, "", 0))
+ TestMountable.should_receive(:run!).and_return(double(:output => @mount_out2))
TestMountable.mount_point_exists?('/mnt/usb').should be_false
end
end
end
describe "#mount_point_available?" do
it "uses mount" do
- TestMountable.should_receive(:run!).with(TestMountable.cmd(:mount)).and_return(CommandResult.new("", "", "", 0))
+ TestMountable.should_receive(:run!).with(TestMountable.cmd(:mount)).and_return(double(:output => ""))
TestMountable.mount_point_available?('/mnt/usb')
end
context "disk mounted at specified location" do
it "returns false" do
- TestMountable.should_receive(:run!).and_return(CommandResult.new("", @mount_out1, "", 0))
+ TestMountable.should_receive(:run!).and_return(double(:output => @mount_out1))
TestMountable.mount_point_available?('/mnt/usb').should be_false
end
end
context "no disk mounted at specified location" do
it "returns true" do
- TestMountable.should_receive(:run!).and_return(CommandResult.new("", @mount_out2, "", 0))
+ TestMountable.should_receive(:run!).and_return(double(:output => @mount_out2))
TestMountable.mount_point_available?('/mnt/usb').should be_true
end
end
end
@@ -83,11 +83,11 @@
end
describe "#mount" do
it "sets mount point" do
# ignore actual mount cmds
- @mountable.should_receive(:run!).and_return(CommandResult.new("", "", "", ""))
- TestMountable.should_receive(:run!).and_return(CommandResult.new("", "", "", ""))
+ @mountable.should_receive(:run!).and_return(double(:output => ""))
+ TestMountable.should_receive(:run!).and_return(double(:output => ""))
@mountable.mount('/mnt/sda2').should == '/mnt/sda2'
@mountable.mount_point.should == '/mnt/sda2'
end