From 7c7f279c9b61a89240f93c0339042cbd7485d0c5 Mon Sep 17 00:00:00 2001 From: "rff.rff" Date: Mon, 14 Jan 2008 01:34:44 +0100 Subject: add should('foo') shortcut for it('should foo') darcs-hash:20080114003444-16231-e4a97d3932c8636751d72f101e0363c124522390.gz --- test/spec_should.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/spec_should.rb (limited to 'test') diff --git a/test/spec_should.rb b/test/spec_should.rb new file mode 100644 index 0000000..be34038 --- /dev/null +++ b/test/spec_should.rb @@ -0,0 +1,34 @@ +$: << File.dirname(__FILE__) + '/../lib/' +require 'bacon' + + +describe "#should shortcut for #it('should')" do + + should "be called" do + @called= true + end + + should "save some characters by typing should" do + lambda { should.satisfy { 1 == 1 } }.should.not.raise + end + + should "save characters even on failure" do + lambda { should.satisfy { 1 == 2 } }.should.raise Bacon::Error + end + + should "work nested" do + should.satisfy {1==1} + end + + + count = Bacon::Counter[:specifications] + should "add new specifications" do + # XXX this should +=1 but it's +=2 + (count+1).should == Bacon::Counter[:specifications] + end + + should "have been called" do + @called.should.be == true + end + +end -- cgit 1.4.1