Sha256: 15d7d808eb2f2006a23b2bfe985f36c28d3b00a6e086e89492605077c6c5bba6

Contents?: true

Size: 426 Bytes

Versions: 8

Compression:

Stored size: 426 Bytes

Contents

class InvokrTest < Minitest::Test
  def test_supplying_proc
    my_proc = ->a,b{a+b}

    result = Invokr.invoke proc: my_proc, with: { a: 1, b: 4 }

    assert_equal 5, result
  end

  def test_incorrectly_invoking
    error = assert_raises Invokr::InputError do
      Invokr.invoke
    end

    assert_equal(
      "cannot invoke; missing required arguments: `method', `on' and `with'",
      error.message,
    )
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
invokr-0.9.5 test/invokr_test.rb
invokr-0.9.4 test/invokr_test.rb
invokr-0.9.3 test/invokr_test.rb
invokr-0.9.2 test/invokr_test.rb
invokr-0.9.1 test/invokr_test.rb
invokr-0.9.0 test/invokr_test.rb
invokr-0.1.0 test/invokr_test.rb
invokr-0.0.6 test/invokr_test.rb