Permalink
Browse files

add spec for arguments to original method

  • Loading branch information...
1 parent 019eab6 commit 5bc68ac02b038cbfbdd97bf74c60e542c7a4d2af @garybernhardt committed Apr 17, 2011
Showing with 7 additions and 10 deletions.
  1. +6 −9 spec/do_not_want_spec.rb
  2. +1 −1 spec/gems/fake_gem.rb
View
@@ -1,17 +1,10 @@
-module ActiveRecord
- class Base
- def update_attribute; end
- def save; end
- end
-end
-
require 'do_not_want'
require 'gems/fake_gem'
class Walrus
- def be_killed_by!(killer)
+ def be_killed_by!(killer, reason)
die!
- "killed by #{killer}"
+ "killed by #{killer} because #{reason}"
end
def die!
@@ -41,6 +34,10 @@ def die!
kill_walrus(walrus)
end.not_to raise_error
end
+
+ it "passes arguments" do
+ kill_walrus(walrus).should == 'killed by kitty because kitty is angry'
+ end
end
end
View
@@ -1,4 +1,4 @@
def kill_walrus(walrus)
- walrus.be_killed_by!('kitty')
+ walrus.be_killed_by!('kitty', 'kitty is angry')
end

0 comments on commit 5bc68ac

Please sign in to comment.