class NodeCollectionWithPostdefinedContextsTest

Public Instance Methods

setup() click to toggle source
# File test/unit/node_collection_test.rb, line 294
def setup
  machine = StateMachine::Machine.new(Class.new)
  @collection = StateMachine::NodeCollection.new(machine)
  @collection << Node.new(:parked)
end
test_should_not_run_contexts_if_not_matched() click to toggle source
# File test/unit/node_collection_test.rb, line 306
def test_should_not_run_contexts_if_not_matched
  contexts_run = []
  @collection.context([:idling]) { contexts_run << :idling }
  assert_equal [], contexts_run
end
test_should_run_context_if_matched() click to toggle source
# File test/unit/node_collection_test.rb, line 300
def test_should_run_context_if_matched
  contexts_run = []
  @collection.context([:parked]) { contexts_run << :parked }
  assert_equal [:parked], contexts_run
end