Sha256: 57ec341c29007d82b981236a88496b958d03274143c2d66955b128e1a5c60d21

Contents?: true

Size: 996 Bytes

Versions: 14

Compression:

Stored size: 996 Bytes

Contents

require_relative '../../test_helper'

class PathCollectionTest < StateMachinesTest
  def setup
    @klass = Class.new
    @machine = StateMachines::Machine.new(@klass)
    @object = @klass.new
  end

  def test_should_raise_exception_if_invalid_option_specified
    exception = assert_raises(ArgumentError) { StateMachines::PathCollection.new(@object, @machine, invalid: true) }
    assert_equal 'Unknown key: :invalid. Valid keys are: :from, :to, :deep, :guard', exception.message
  end

  def test_should_raise_exception_if_invalid_from_state_specified
    exception = assert_raises(IndexError) { StateMachines::PathCollection.new(@object, @machine, from: :invalid) }
    assert_equal ':invalid is an invalid name', exception.message
  end

  def test_should_raise_exception_if_invalid_to_state_specified
    exception = assert_raises(IndexError) { StateMachines::PathCollection.new(@object, @machine, to: :invalid) }
    assert_equal ':invalid is an invalid name', exception.message
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
state_machines-0.5.0 test/unit/path_collection/path_collection_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/unit/path_collection/path_collection_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/unit/path_collection/path_collection_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/unit/path_collection/path_collection_test.rb
state_machines-0.4.0 test/unit/path_collection/path_collection_test.rb
state_machines-0.3.0 test/unit/path_collection/path_collection_test.rb
state_machines-0.2.2 test/unit/path_collection/path_collection_test.rb
state_machines-0.2.1 test/unit/path_collection/path_collection_test.rb
state_machines-0.2.0 test/unit/path_collection/path_collection_test.rb
state_machines-0.1.4 test/unit/path_collection/path_collection_test.rb
state_machines-0.1.3 test/unit/path_collection/path_collection_test.rb
state_machines-0.1.2 test/unit/path_collection/path_collection_test.rb
state_machines-0.1.1 test/unit/path_collection/path_collection_test.rb
state_machines-0.1.0 test/unit/path_collection/path_collection_test.rb