diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2007-12-05 01:56:29 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2007-12-05 01:56:29 +0100 |
commit | f41bc742a0bc006cfdf02c014f90ba2b613ee292 (patch) | |
tree | 869547486546430fa8f3268ec6d81806528097b3 /test | |
parent | 4b38b8e7b8943c91c72fa1b5f74c64f9ca94f6d1 (diff) | |
download | bacon-f41bc742a0bc006cfdf02c014f90ba2b613ee292.tar.gz bacon-f41bc742a0bc006cfdf02c014f90ba2b613ee292.tar.xz bacon-f41bc742a0bc006cfdf02c014f90ba2b613ee292.zip |
Add should.throw
darcs-hash:20071205005629-4fc50-9383518bf564264235d38f2fbd3059cccb6d3885.gz
Diffstat (limited to 'test')
-rw-r--r-- | test/spec_bacon.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/spec_bacon.rb b/test/spec_bacon.rb index cfbb7bb..0f6e95e 100644 --- a/test/spec_bacon.rb +++ b/test/spec_bacon.rb @@ -196,6 +196,16 @@ describe "Bacon" do lambda { nil.should.not.bla }.should.raise(NoMethodError) end + it "should have should.raise" do + lambda { lambda { bla }.should.raise(NameError) }.should succeed + lambda { lambda { nil }.should.raise(NameError) }.should fail + end + + it "should have should.throw" do + lambda { lambda { throw :foo }.should.throw(:foo) }.should succeed + lambda { lambda { :foo }.should.throw(:foo) }.should fail + end + it "should have should <operator> (>, >=, <, <=, ===)" do lambda { 2.should.be > 1 }.should succeed lambda { 1.should.be > 2 }.should fail |