Skip to content

Instantly share code, notes, and snippets.

@rdammkoehler
Created October 13, 2011 14:38
Show Gist options
  • Select an option

  • Save rdammkoehler/1284365 to your computer and use it in GitHub Desktop.

Select an option

Save rdammkoehler/1284365 to your computer and use it in GitHub Desktop.
Can't get Gimme to match GregorianCalendar for verify
#I'm having a verify issue with gimme, I don't know if I've written the verify wrong or if gimme
# does not support matches against Java classes.
#
require 'gimme'
require 'orchestrator'
java_import java.util.Calendar
describe Orchestrator do
describe "Pull" do
describe "Orders" do
before :all do
@mock_orders_service = gimme OrdersWebService
give(@mock_orders_service).orders(anything,anything) { [] }
@orchestrator = Orchestrator.new @mock_orders_service #inject mock
end
it "uses the OrdersWebService" do
@orchestrator.pull :orders #will use mock with 2 Calendars
verify(@mock_orders_service).orders(is_a(GregorianCalendar), is_a(GregorianCalendar))
end
end
end
end
#Failures:
#
# 1) Orchestrator Pull Orders uses the OrdersWebService
# Failure/Error: verify(@mock_orders_service).orders(is_a(GregorianCalendar), is_a(GregorianCalendar))
# Gimme::Errors::VerificationFailedError:
# expected orders to have been called with #<Gimme::Matchers::IsA:0x430a14ad>#<Gimme::Matchers::IsA:0x4ad38c3d>
# # ./spec/lib/orchestrator_spec.rb:30:in `(root)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment