Sha256: 6f03bf55d29eb89c0301ddf009d1d9c99c1b82cf45d74823c55b2bda2863afd1

Contents?: true

Size: 570 Bytes

Versions: 2

Compression:

Stored size: 570 Bytes

Contents

require 'helper'

class Bender
  include Transitions

  state_machine do
    state :drinking
    state :smoking
    state :gambling

    event :cough do
      transitions from: :smoking, to: :gambling
    end
  end
end

class TestAvailableStatesListing < Test::Unit::TestCase
  test 'available_states should return the states for the state machine' do
    assert_equal [:drinking, :gambling, :smoking], Bender.available_states
  end
  test 'available_events should return the events for the state machine' do
    assert_equal [:cough], Bender.available_events
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
transitions-1.0.0 test/machine/test_available_states_listing.rb
transitions-0.2.1 test/machine/test_available_states_listing.rb