Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support duck typed commits and switch to Rspec #1

Merged
merged 7 commits into from
Jan 12, 2015
Merged

Support duck typed commits and switch to Rspec #1

merged 7 commits into from
Jan 12, 2015

Conversation

lserman
Copy link
Contributor

@lserman lserman commented Jan 12, 2015

I didn't like how UpAndAtThem::Transaction ensured that it's tasks were UpAndAtThem::Commit's. I made it so that UpAndAtThem::Transaction will just call #call and #rollback on the tasks without worrying about type.

This makes it possible to do stuff like

class ExamplePayment
  def call
    # logic to make a payment
  end

  def rollback
    # logic to refund a payment
  end
end

UpAndAtThem::Transaction[ExamplePayment.new]

I think it makes sense to put the payment logic in it's own class and without having to worry about wrapping it inside a UpAndAtThem::Commit.

Also, I moved the tests to Rspec since that's what most devs at Metova are familiar with (ok ok... it's because I couldn't figure out how to run the Minitest tests...)

NotDaveLane added a commit that referenced this pull request Jan 12, 2015
Support duck typed commits and switch to Rspec
@NotDaveLane NotDaveLane merged commit 5780a56 into metova:master Jan 12, 2015
@NotDaveLane
Copy link
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants