Sha256: d6b25699fbc61c2e7f20a10aaedc2d3a8f80735353d0d146268f0247303758cb

Contents?: true

Size: 340 Bytes

Versions: 2

Compression:

Stored size: 340 Bytes

Contents

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

class RequireOptional < Minitest::Test
  def test_require_optional
    assert_nil require_optional("non_existent")
  end

  def test_require_optional_with_block
    res = require_optional("non_existent") { 42 }

    assert_equal res, 42
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shenanigans-1.0.15 test/kernel/require_optional_test.rb
shenanigans-1.0.14 test/kernel/require_optional_test.rb