Sha256: d11a429e12a1566c84ffb1ce65d4978f3ec83e6bd5361addb814e6d54f1416cf

Contents?: true

Size: 672 Bytes

Versions: 14

Compression:

Stored size: 672 Bytes

Contents

require_relative '../../test_helper'

class CallbackWithMixedMethodsTest < StateMachinesTest
  def setup
    @callback = StateMachines::Callback.new(:before, :run_argument, do: :run_do) do |object|
      object.callbacks << :block
    end

    class << @object = Object.new
      attr_accessor :callbacks

      def run_argument
        (@callbacks ||= []) << :argument
      end

      def run_do
        (@callbacks ||= []) << :do
      end
    end

    @result = @callback.call(@object)
  end

  def test_should_be_successful
    assert @result
  end

  def test_should_call_each_callback_in_order
    assert_equal [:argument, :do, :block], @object.callbacks
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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