From f41bc742a0bc006cfdf02c014f90ba2b613ee292 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 5 Dec 2007 01:56:29 +0100 Subject: Add should.throw darcs-hash:20071205005629-4fc50-9383518bf564264235d38f2fbd3059cccb6d3885.gz --- test/spec_bacon.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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 (>, >=, <, <=, ===)" do lambda { 2.should.be > 1 }.should succeed lambda { 1.should.be > 2 }.should fail -- cgit 1.4.1