lib/bogus/verifies_contracts.rb in bogus-0.0.4 vs lib/bogus/verifies_contracts.rb in bogus-0.1.0
- old
+ new
@@ -1,16 +1,18 @@
-class Bogus::VerifiesContracts
- extend Bogus::Takes
+module Bogus
+ class VerifiesContracts
+ extend Takes
- takes :doubled_interactions, :real_interactions
+ takes :doubled_interactions, :real_interactions
- def verify(fake_name)
- missed = doubled_interactions.for_fake(fake_name).reject do |interaction|
- real_interactions.recorded?(fake_name, interaction)
- end
+ def verify(fake_name)
+ missed = doubled_interactions.for_fake(fake_name).reject do |interaction|
+ real_interactions.recorded?(fake_name, interaction)
+ end
- unless missed.empty?
- actual = real_interactions.for_fake(fake_name)
- raise Bogus::ContractNotFulfilled.new(fake_name, missed: missed, actual: actual)
+ unless missed.empty?
+ actual = real_interactions.for_fake(fake_name)
+ raise Bogus::ContractNotFulfilled.new(fake_name, missed: missed, actual: actual)
+ end
end
end
end