summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/spec_should.rb34
1 files changed, 34 insertions, 0 deletions
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