class PathCollectionTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/path_collection_test.rb, line 49 def setup @klass = Class.new @machine = StateMachine::Machine.new(@klass) @object = @klass.new end
test_should_raise_exception_if_invalid_from_state_specified()
click to toggle source
# File test/unit/path_collection_test.rb, line 60 def test_should_raise_exception_if_invalid_from_state_specified exception = assert_raise(IndexError) {StateMachine::PathCollection.new(@object, @machine, :from => :invalid)} assert_equal ':invalid is an invalid name', exception.message end
test_should_raise_exception_if_invalid_option_specified()
click to toggle source
# File test/unit/path_collection_test.rb, line 55 def test_should_raise_exception_if_invalid_option_specified exception = assert_raise(ArgumentError) {StateMachine::PathCollection.new(@object, @machine, :invalid => true)} assert_equal 'Invalid key(s): invalid', exception.message end
test_should_raise_exception_if_invalid_to_state_specified()
click to toggle source
# File test/unit/path_collection_test.rb, line 65 def test_should_raise_exception_if_invalid_to_state_specified exception = assert_raise(IndexError) {StateMachine::PathCollection.new(@object, @machine, :to => :invalid)} assert_equal ':invalid is an invalid name', exception.message end