Sha256: e56fea8bdffcba72d6ad0d0871c31b1ef073f014ac491cb377251647f7d8685e

Contents?: true

Size: 429 Bytes

Versions: 1

Compression:

Stored size: 429 Bytes

Contents

require 'minitest/autorun'
require 'callchain'


class BindTest < Minitest::Test
  def test_calls_method
    chain_class = Class.new
    chain_class.extend(CallChain)
    chain_class.use CallChain[:to_i]
    assert_equal 1, chain_class.call('1')
  end

  def test_binds_args
    chain_class = Class.new
    chain_class.extend(CallChain)
    chain_class.use CallChain.bind(:+, 1)
    assert_equal 2, chain_class.call(1)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
callchain-0.0.2 test/bind_test.rb