Sha256: a89de2f99af8a2e45f57d469e83731a49003dd31b187e9df4f26049b977387fb

Contents?: true

Size: 606 Bytes

Versions: 14

Compression:

Stored size: 606 Bytes

Contents

require_relative '../../test_helper'

class CallbackWithMultipleBoundMethodsTest < StateMachinesTest
  def setup
    @object = Object.new

    first_context = nil
    second_context = nil

    @callback = StateMachines::Callback.new(:before, do: [lambda { first_context = self }, lambda { second_context = self }], bind_to_object: true)
    @callback.call(@object)

    @first_context = first_context
    @second_context = second_context
  end

  def test_should_call_each_method_within_the_context_of_the_object
    assert_equal @object, @first_context
    assert_equal @object, @second_context
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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