class NodeCollectionByDefaultTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/node_collection_test.rb, line 14 def setup @machine = StateMachine::Machine.new(Class.new) @collection = StateMachine::NodeCollection.new(@machine) end
test_should_have_a_machine()
click to toggle source
# File test/unit/node_collection_test.rb, line 23 def test_should_have_a_machine assert_equal @machine, @collection.machine end
test_should_index_by_name()
click to toggle source
# File test/unit/node_collection_test.rb, line 27 def test_should_index_by_name @collection << object = Node.new(:parked) assert_equal object, @collection[:parked] end
test_should_not_have_any_nodes()
click to toggle source
# File test/unit/node_collection_test.rb, line 19 def test_should_not_have_any_nodes assert_equal 0, @collection.length end