Sha256: 51098e24d3eaff39decc2c6372d10f6b8a38b0f2afc11c6f783427e1fd536d42

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

require 'minitest/autorun'
require 'minitest/around'

class TestWithoutAround < Minitest::Test
  def test_no_around_defined
    assert true
  end
end

class TestWithoutArgs < Minitest::Test
  def around
    $before = true
    yield
    $before = false # hard to test?
  end

  def test_runs_around
    assert_equal true, $before
  end
end

class TestWithSingleArg < Minitest::Test
  def around
    yield "string"
  end

  def test_around_passes_string(string)
    assert_equal "string", string
  end
end

class TestWithMultipleArgs < Minitest::Test
  def around
    yield 1, 2
  end

  def test_passes_multiple_args(a, b)
    assert_equal 1, a
    assert_equal 2, b
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minitest-around-0.1.0.pre test/around_test.rb