Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

verifies dsl

  • Loading branch information...
commit 4060212e86d1b888e84e8fd62517a1002b5fe79a 1 parent 796ec94
@searls authored
Showing with 17 additions and 12 deletions.
  1. +5 −1 lib/gimme/dsl.rb
  2. +12 −11 spec/gimme/verifies_class_methods_spec.rb
View
6 lib/gimme/dsl.rb
@@ -37,7 +37,11 @@ def give!(double)
# Verification
def verify(double,times=1)
- Gimme::Verifies.new(double,times)
+ if double.kind_of? Class
+ Gimme::VerifiesClassMethods.new(double, times)
+ else
+ Gimme::Verifies.new(double,times)
+ end
end
def verify!(double,times=1)
View
23 spec/gimme/verifies_class_methods_spec.rb
@@ -30,16 +30,17 @@ def self.ferment(beans=nil,time=nil)
end
end
- # context "gimme DSL" do
- # Given { spy_on(Natto, :ferment)}
- #
- # it_behaves_like "a verifier" do
- # Given(:verifier) { verify(test_double) }
- # end
- #
- # it_behaves_like "an overridden verifier" do
- # Given(:verifier) { verify!(test_double) }
- # end
- # end
+ context "gimme DSL" do
+ Given { spy_on(Natto, :ferment)}
+
+ it_behaves_like "a verifier" do
+ Given(:verifier) { verify(test_double) }
+ end
+
+ it_behaves_like "an overridden verifier" do
+ Given { spy_on!(Natto, :eat) }
+ Given(:verifier) { verify!(test_double) }
+ end
+ end
end
end

0 comments on commit 4060212

Please sign in to comment.
Something went wrong with that request. Please try again.