Sha256: d162212ac9a3f5682d39b81253bfde63f49d00ece06fb761a307ea3bcd512fb3

Contents?: true

Size: 571 Bytes

Versions: 14

Compression:

Stored size: 571 Bytes

Contents

require_relative '../../test_helper'

class StateWithNamespaceTest < StateMachinesTest
  def setup
    @klass = Class.new
    @machine = StateMachines::Machine.new(@klass, namespace: 'alarm')
    @machine.states << @state = StateMachines::State.new(@machine, :active)
    @object = @klass.new
  end

  def test_should_have_a_name
    assert_equal :active, @state.name
  end

  def test_should_have_a_qualified_name
    assert_equal :alarm_active, @state.qualified_name
  end

  def test_should_namespace_predicate
    assert @object.respond_to?(:alarm_active?)
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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