summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2012-02-26 17:50:46 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2012-02-26 17:50:46 +0100
commit6d7a1a2c5566b292206fcf49bb0301f7d15bd48e (patch)
treeeb573b2b14399d82dc086c1a7d0d6c84a4d0d69b
parent876a8b7e84579ad8cc79bc2aa95a8013c2c72c50 (diff)
downloadbacon-6d7a1a2c5566b292206fcf49bb0301f7d15bd48e.tar.gz
bacon-6d7a1a2c5566b292206fcf49bb0301f7d15bd48e.tar.xz
bacon-6d7a1a2c5566b292206fcf49bb0301f7d15bd48e.zip
Add specs for change?
-rw-r--r--test/spec_bacon.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/spec_bacon.rb b/test/spec_bacon.rb
index 79cdeb1..1d2a7d3 100644
--- a/test/spec_bacon.rb
+++ b/test/spec_bacon.rb
@@ -62,6 +62,23 @@ describe "Bacon" do
     }.should.raise
   end
 
+  it "should have should.change" do
+    lambda { lambda {}.should.change { Time.now } }.should succeed
+
+    lambda {
+      i = 1
+      lambda { i *= 2 }.should.change { i }
+    }.should succeed
+
+    lambda {
+      i = 0
+      lambda { i *= 2 }.should.change { i }
+    }.should fail
+
+    lambda { should.change { Time.now } }.should succeed
+    lambda { should.change { 42 } }.should fail
+  end
+
   it "should have should.raise with a block" do
     lambda { should.raise { raise "Error" } }.should succeed
     lambda { should.raise(RuntimeError) { raise "Error" } }.should succeed