Sha256: a72cac7c3df4f587ac88f97435a520ea03cb11bcda2239d0ecec612f26b60cf5

Contents?: true

Size: 369 Bytes

Versions: 4

Compression:

Stored size: 369 Bytes

Contents

require 'minitest/autorun'
require 'shenanigans/kernel/require_optional'
require 'stringio'

class RequireOptional < MiniTest::Unit::TestCase
  def test_require_optional
    assert_equal require_optional('non_existent'), nil
  end

  def test_require_optional_with_block
    res = require_optional 'non_existent' do
      42
    end

    assert_equal res, 42
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shenanigans-1.0.13 test/kernel/test_require_optional.rb
shenanigans-1.0.11 test/kernel/test_require_optional.rb
shenanigans-1.0.10 test/kernel/test_require_optional.rb
shenanigans-1.0.9 test/kernel/test_require_optional.rb