class NodeCollectionWithPredefinedContextsTest

Public Instance Methods

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