Sha256: 3a864b9fe13a0b1c23070e87334fd3da6cfce3d57d3d29796f68b018b947a8e9

Contents?: true

Size: 518 Bytes

Versions: 14

Compression:

Stored size: 518 Bytes

Contents

require_relative '../../test_helper'

class StateWithInvalidMethodCallTest < StateMachinesTest
  def setup
    @klass = Class.new
    @machine = StateMachines::Machine.new(@klass)
    @ancestors = @klass.ancestors
    @machine.states << @state = StateMachines::State.new(@machine, :idling)
    @state.context do
      def speed
        0
      end
    end

    @object = @klass.new
  end

  def test_should_call_method_missing_arg
    assert_equal 1, @state.call(@object, :invalid, method_missing: -> { 1 })
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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