spec/screen_spec.rb in scide-0.0.11 vs spec/screen_spec.rb in scide-0.0.12

- old
+ new

@@ -68,11 +68,18 @@ screen = Scide::Screen.new @project, options screen.options.should == options screen.options.should_not equal(options) end + it "should not raise any error if the screen binary is found" do + screen = '/usr/bin/screen' + Which.stub!(:which){ |name| screen } unless File.executable?(screen) + lambda{ SpecHelper.silence{ Scide::Screen.new(@project, :binary => screen).check_binary } }.should_not raise_error + end + it "should exit with status 4 if the screen binary is not found" do - bad_binary = "IHateYouIfYouAddedThisBinaryJustToMakeMyTestFail" + bad_binary = "unknown" + Which.stub!(:which){ |name| nil } lambda{ SpecHelper.silence{ Scide::Screen.new(@project, :binary => bad_binary).check_binary } }.should raise_error(SystemExit){ |err| err.status.should == 4 } end it "should raise an error if the options are not nil and not a hash" do [ ' ', [] ].each do |not_hash|