summary refs log tree commit diff
path: root/test/spec_bacon.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec_bacon.rb')
-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