Skip to content

Instantly share code, notes, and snippets.

@floehopper
Created July 12, 2012 17:41
Show Gist options
  • Save floehopper/3099572 to your computer and use it in GitHub Desktop.
Save floehopper/3099572 to your computer and use it in GitHub Desktop.
WarrantyClaimWorkflow
describe WarrantyClaimWorkflow do
it "yields a SuccessResult" do
executed = false
subject.handle(event_that_succeeds) do |result|
result.on_success { executed = true }
end
assert executed
end
it "yields a FailureResult" do
executed = false
subject.handle(event_that_fails) do |result|
result.on_success { executed = true }
end
refute executed
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment