Sha256: 216293a83234b567d6768e01eb78cf9f063fa532b88d21bcf3b98dcbaa32b954

Contents?: true

Size: 722 Bytes

Versions: 5

Compression:

Stored size: 722 Bytes

Contents

require "helper"

class Bender
  include Transitions

  state_machine :default do
    state :drinking
    state :smoking
    state :gambling
  end

  state_machine :maintenance do
    state :wip
    state :finished
  end
end

class TestAvailableStatesListing < Test::Unit::TestCase
  test 'available_states should return the states for the default state machine if no state machine is specified' do
    assert_equal [:drinking, :gambling, :smoking], Bender.available_states
  end

  test 'available_states should return the states for a given state' do
    assert_equal [:finished, :wip], Bender.available_states(:maintenance)
    assert_equal [:drinking, :gambling, :smoking], Bender.available_states(:default)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
transitions-0.0.18 test/test_available_states_listing.rb
transitions-0.0.17 test/test_available_states_listing.rb
transitions-0.0.16 test/test_available_states_listing.rb
transitions-0.0.14 test/test_available_states_listing.rb
transitions-0.0.13 test/test_available_states_listing.rb