Sha256: fef2f1d200dff0e06b4e03888a89983953fc459a3559a41b0693c5d9f89f8bb3

Contents?: true

Size: 570 Bytes

Versions: 6

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

6 entries across 6 versions & 1 rubygems

Version Path
transitions-0.2.0 test/machine/test_available_states_listing.rb
transitions-0.1.13 test/machine/test_available_states_listing.rb
transitions-0.1.12 test/machine/test_available_states_listing.rb
transitions-0.1.11 test/machine/test_available_states_listing.rb
transitions-0.1.10 test/machine/test_available_states_listing.rb
transitions-0.1.9 test/machine/test_available_states_listing.rb