Sha256: a8da061a9e34caef300de995b897f7250ce9274d074b28407e2866e325e69fae
Contents?: true
Size: 748 Bytes
Versions: 11
Compression:
Stored size: 748 Bytes
Contents
require_relative '../../test_helper' class TransitionCollectionWithoutTransactionsTest < StateMachinesTest def setup @klass = Class.new do attr_accessor :ran_transaction end @machine = StateMachines::Machine.new(@klass, initial: :parked) @machine.state :idling @machine.event :ignite class << @machine def within_transaction(object) object.ran_transaction = true end end @object = @klass.new @transitions = StateMachines::TransitionCollection.new([ StateMachines::Transition.new(@object, @machine, :ignite, :parked, :idling) ], transaction: false) @transitions.perform end def test_should_not_run_within_transaction refute @object.ran_transaction end end
Version data entries
11 entries across 11 versions & 2 rubygems