Permalink
Browse files

moving along

  • Loading branch information...
1 parent 84f6941 commit 53d3d5331874e7b2b9c00b452bab6556663732cc @dchelimsky committed Oct 10, 2009
Showing with 21 additions and 0 deletions.
  1. BIN RSpecTipsAndTricks.key
  2. +21 −0 code/matchers/default_messages.rb
View
BIN RSpecTipsAndTricks.key
Binary file not shown.
View
21 code/matchers/default_messages.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+Spec::Matchers.define :have_a_balance_of do |money|
+ match do |account|
+ account.balance == money
+ end
+end
+
+describe Account do
+ context "when first created" do
+ it "has a zero balance" do
+ account = Account.new
+ account.should have_a_balance_of(Money.new(0, :BLR))
+ end
+
+ it "does not have a non- balance" do
+ account = Account.new
+ account.should_not have_a_balance_of(Money.new(10, :BLR))
+ end
+ end
+end

0 comments on commit 53d3d53

Please sign in to comment.