Sha256: 2a7b7ee9409356e84c198d569ec9f0dde3685f2cb9d961f5168f930385644885

Contents?: true

Size: 559 Bytes

Versions: 4

Compression:

Stored size: 559 Bytes

Contents

require "minitest/autorun"
require "minitest/pride"

$: << File.dirname(__FILE__) + "/../lib"

Minitest::Test.class_eval do
  def refute_warnings_emitted(&block)
    _, stderr = capture_io(&block)

    assert stderr.empty?, -> do
      warnings = stderr.strip.split("\n").map { |line| "  #{line}" }.join("\n")
      "Expected no warnings to be emitted, but these ones were:\n\n#{warnings}"
    end
  end

  def refute_raises_anything
    yield
  rescue => error
    flunk "Expected no error to be raised, but got #{error.class} (#{error.message})."
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attr_extras-7.1.0 spec/spec_helper_without_loading_attr_extras.rb
attr_extras-7.0.0 spec/spec_helper_without_loading_attr_extras.rb
attr_extras-6.2.5 spec/spec_helper_without_loading_attr_extras.rb
attr_extras-6.2.4 spec/spec_helper_without_loading_attr_extras.rb