class NodeCollectionTest

Public Instance Methods

setup() click to toggle source
# File test/unit/node_collection_test.rb, line 34
def setup
  @machine = StateMachine::Machine.new(Class.new)
  @collection = StateMachine::NodeCollection.new(@machine)
end
test_should_raise_exception_if_invalid_option_specified() click to toggle source
# File test/unit/node_collection_test.rb, line 39
def test_should_raise_exception_if_invalid_option_specified
  exception = assert_raise(ArgumentError) { StateMachine::NodeCollection.new(@machine, :invalid => true) }
  assert_equal 'Invalid key(s): invalid', exception.message
end
test_should_raise_exception_on_fetch_if_invalid_index_specified() click to toggle source
# File test/unit/node_collection_test.rb, line 49
def test_should_raise_exception_on_fetch_if_invalid_index_specified
  exception = assert_raise(ArgumentError) { @collection.fetch(:something, :invalid) }
  assert_equal 'Invalid index: :invalid', exception.message
end
test_should_raise_exception_on_lookup_if_invalid_index_specified() click to toggle source
# File test/unit/node_collection_test.rb, line 44
def test_should_raise_exception_on_lookup_if_invalid_index_specified
  exception = assert_raise(ArgumentError) { @collection[:something, :invalid] }
  assert_equal 'Invalid index: :invalid', exception.message
end