Sha256: 3d321862f775a677386afb8e51cc90ce3d4fe961772b0bab23f9c8fef38967df
Contents?: true
Size: 829 Bytes
Versions: 8
Compression:
Stored size: 829 Bytes
Contents
require 'cooperator' class First prepend Cooperator def perform end def rollback $first = true end end class Second prepend Cooperator def perform end def rollback $second = true end end class Third prepend Cooperator def perform failure! end def rollback $third = true end end class Interactor prepend Cooperator def perform cooperate First, Second, Third end end prepare do $first = false $second = false $third = false end spec 'third rollback is not called when a failure is encountered' do Interactor.perform refute $third end spec 'second rollback is called when a failure is encountered' do Interactor.perform assert $second end spec 'first rollback is called when a failure is encountered' do Interactor.perform assert $first end
Version data entries
8 entries across 8 versions & 1 rubygems