Sha256: a316d99a3e13ce153c95d3524317ec337266760a153696717ac1704880c4ba30
Contents?: true
Size: 664 Bytes
Versions: 14
Compression:
Stored size: 664 Bytes
Contents
require_relative '../../test_helper' require_relative '../../files/node' class NodeCollectionWithPostdefinedContextsTest < StateMachinesTest def setup machine = StateMachines::Machine.new(Class.new) @collection = StateMachines::NodeCollection.new(machine) @collection << Node.new(:parked) end def test_should_run_context_if_matched contexts_run = [] @collection.context([:parked]) { contexts_run << :parked } assert_equal [:parked], contexts_run end def test_should_not_run_contexts_if_not_matched contexts_run = [] @collection.context([:idling]) { contexts_run << :idling } assert_equal [], contexts_run end end
Version data entries
14 entries across 14 versions & 2 rubygems