Sha256: 86d387154c1c3dc38b631c6733f8e4f4f9027dd7c5c056eda35ed76396f094cb

Contents?: true

Size: 613 Bytes

Versions: 14

Compression:

Stored size: 613 Bytes

Contents

require_relative '../../test_helper'

class Validateable
  class << self
    def validate(*args, &block)
      args << block if block_given?
      args
    end
  end
end

class StateContextTest < StateMachinesTest
  def setup
    @klass = Class.new(Validateable)
    @machine = StateMachines::Machine.new(@klass, initial: :parked)
    @state = @machine.state :parked

    @state_context = StateMachines::StateContext.new(@state)
  end

  def test_should_have_a_machine
    assert_equal @machine, @state_context.machine
  end

  def test_should_have_a_state
    assert_equal @state, @state_context.state
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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