Sha256: 91b80dd4ab269febd922d47edefa5eb6ac8adac612c9893fceb9d1e975931faa

Contents?: true

Size: 962 Bytes

Versions: 14

Compression:

Stored size: 962 Bytes

Contents

require_relative '../../test_helper'

class PathCollectionByDefaultTest < StateMachinesTest
  def setup
    @klass = Class.new
    @machine = StateMachines::Machine.new(@klass)
    @machine.state :parked

    @object = @klass.new
    @object.state = 'parked'

    @paths = StateMachines::PathCollection.new(@object, @machine)
  end

  def test_should_have_an_object
    assert_equal @object, @paths.object
  end

  def test_should_have_a_machine
    assert_equal @machine, @paths.machine
  end

  def test_should_have_a_from_name
    assert_equal :parked, @paths.from_name
  end

  def test_should_not_have_a_to_name
    assert_nil @paths.to_name
  end

  def test_should_have_no_from_states
    assert_equal [], @paths.from_states
  end

  def test_should_have_no_to_states
    assert_equal [], @paths.to_states
  end

  def test_should_have_no_events
    assert_equal [], @paths.events
  end

  def test_should_have_no_paths
    assert @paths.empty?
  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_by_default_test.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/test/unit/path_collection/path_collection_by_default_test.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/test/unit/path_collection/path_collection_by_default_test.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.4.0 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.3.0 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.2.2 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.2.1 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.2.0 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.1.4 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.1.3 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.1.2 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.1.1 test/unit/path_collection/path_collection_by_default_test.rb
state_machines-0.1.0 test/unit/path_collection/path_collection_by_default_test.rb