Sha256: e3d614b6ccf1ac175b1b024714e18dc574a721cb428bacf0df4f1438711f42d1

Contents?: true

Size: 846 Bytes

Versions: 14

Compression:

Stored size: 846 Bytes

Contents

require_relative '../../test_helper'

class EventStringCollectionTest < StateMachinesTest
  def setup
    machine = StateMachines::Machine.new(Class.new, namespace: 'alarm')
    @events = StateMachines::EventCollection.new(machine)

    @events << @open = StateMachines::Event.new(machine, 'enable')
    machine.events.concat(@events)
  end

  def test_should_index_by_name
    assert_equal @open, @events['enable', :name]
  end

  def test_should_index_by_name_by_default
    assert_equal @open, @events['enable']
  end

  def test_should_index_by_symbol_name
    assert_equal @open, @events[:enable]
  end

  def test_should_index_by_qualified_name
    assert_equal @open, @events['enable_alarm', :qualified_name]
  end

  def test_should_index_by_symbol_qualified_name
    assert_equal @open, @events[:enable_alarm, :qualified_name]
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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