Sha256: 10d37a5a5ea655babd887ca2dc9a6576799fef0d1d66dc63cbb0b0325ce79031
Contents?: true
Size: 1.1 KB
Versions: 3
Compression:
Stored size: 1.1 KB
Contents
require 'helper' describe Scide do before :each do Scide.exit_on_fail = true end after :each do Scide.exit_on_fail = true end it "should have the correct version" do Scide::VERSION.should == File.open(File.join(File.dirname(__FILE__), '..', 'VERSION'), 'r').read end it "should exit on fail by default" do lambda{ SpecHelper.silence{ Scide.fail nil, 'fubar' } }.should raise_error(SystemExit) end it "should exit with the correct status code" do Scide::EXIT.each_pair do |condition,code| lambda{ SpecHelper.silence{ Scide.fail condition, 'fubar' } }.should raise_error(SystemExit){ |err| err.status.should == code } end end it "should raise an error on fail if configured to do so" do Scide.exit_on_fail = false lambda{ Scide.fail nil, 'fubar' }.should raise_error(Scide::Error) end it "should raise an error with the correct condition" do Scide.exit_on_fail = false Scide::EXIT.each_pair do |condition| lambda{ Scide.fail condition, 'fubar' }.should raise_error(Scide::Error){ |err| err.condition.should == condition } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
scide-0.0.9 | spec/scide_spec.rb |
scide-0.0.8 | spec/scide_spec.rb |
scide-0.0.7 | spec/scide_spec.rb |