Sha256: c9a218bd27183a2b598f7c4b2d548edab78f8ce8b3552885ab654877698c5383

Contents?: true

Size: 623 Bytes

Versions: 14

Compression:

Stored size: 623 Bytes

Contents

require_relative '../../test_helper'

class CallbackWithAroundTypeAndTerminatorTest < StateMachinesTest
  def setup
    @object = Object.new
  end

  def test_should_not_halt_if_terminator_does_not_match
    callback = StateMachines::Callback.new(:around, do: lambda { |block| block.call(false); false }, terminator: lambda { |result| result == true })
    callback.call(@object)
  end

  def test_should_not_halt_if_terminator_matches
    callback = StateMachines::Callback.new(:around, do: lambda { |block| block.call(false); false }, terminator: lambda { |result| result == false })
    callback.call(@object)
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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