From 22d47a530ef4932afb254d01cc44fbaac12c3d71 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 5 Dec 2007 02:00:03 +0100 Subject: Refactor tests darcs-hash:20071205010003-4fc50-b80669ebc8e959181962e33a9bef1c8d9edec719.gz --- test/spec_bacon.rb | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/spec_bacon.rb b/test/spec_bacon.rb index 2038e8a..4760331 100644 --- a/test/spec_bacon.rb +++ b/test/spec_bacon.rb @@ -135,6 +135,13 @@ describe "Bacon" do lambda { lambda { raise "Error" }.should.not.raise }.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 + + should.throw(:foo) { throw :foo } + end + it "should have should.not.satisfy" do lambda { should.not.satisfy { 1 == 2 } }.should succeed lambda { should.not.satisfy { 1 == 1 } }.should fail @@ -196,20 +203,6 @@ 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 - - should.raise(NameError) { bla } - end - - it "should have should.throw" do - lambda { lambda { throw :foo }.should.throw(:foo) }.should succeed - lambda { lambda { :foo }.should.throw(:foo) }.should fail - - should.throw(:foo) { throw :foo } - end - it "should have should (>, >=, <, <=, ===)" do lambda { 2.should.be > 1 }.should succeed lambda { 1.should.be > 2 }.should fail -- cgit 1.4.1