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

Skip rollback for failed interactor #6

Merged
merged 3 commits into from
Aug 19, 2013

Conversation

laserlemon
Copy link
Collaborator

This relates to #4 and also fixes a rollback bug for organizers within organizers.

Interactors should be single-purpose. An interactor should not affect
its context until it's performed successfully. This eliminates the need
for cleanup on failure. Only successfully performed interactors within
an organizer will be rolled back.
To accomplish organizer rollback, we store instances rather than classes
in the organizer's "performed" method so that "performed" for nested
organizers is still intact and available.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 7f91024 on skip-rollback-for-failed-interactor into * on master*.

expect(interactor4c).not_to receive(:perform)
expect(interactor5).not_to receive(:perform)

expect(instance4a).to receive(:rollback).once.with(no_args).ordered
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want an explicit not to receive :rollback expectation on instance4b?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no spoon instance4b.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should be.

@emilford
Copy link
Contributor

Super! 👍

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling d56618f on skip-rollback-for-failed-interactor into * on master*.

@laserlemon
Copy link
Collaborator Author

🚦 💚 :shipit: 🙏

emilford added a commit that referenced this pull request Aug 19, 2013
…teractor

Skip rollback for failed interactor
@emilford emilford merged commit 3bf0882 into master Aug 19, 2013
@emilford emilford deleted the skip-rollback-for-failed-interactor branch August 19, 2013 16:03
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.

3 participants