module Test::Unit::CRAP_ASSERTIONS

Public Class Methods

included(mod) click to toggle source
# File lib/test/unit/assertions.rb, line 22
def self.included mod
  mod.send :include, Test::Unit::CRAP_ASSERTIONS
end

Public Instance Methods

assert_block(msg = nil) { || ... } click to toggle source

Fails unless the block returns a true value.

# File lib/test/unit/assertions.rb, line 40
def assert_block msg = nil
  warn "NOTE: MiniTest::Unit::TestCase#assert_block is deprecated, use assert. It will be removed on 2013-01-01. Called from #{caller.first}"
  msg = message(msg) { "Expected block to return true value" }
  assert yield, msg
end
assert_nothing_raised(_ = :ignored) { || ... } click to toggle source
# File lib/test/unit/assertions.rb, line 46
def assert_nothing_raised _ = :ignored                      # 2009-06-01
  self.class.tu_deprecation_warning :assert_nothing_raised
  self._assertions += 1
  yield
rescue => e
  raise MiniTest::Assertion, exception_details(e, "Exception raised:")
end
build_message(user_message, template_message, *args) click to toggle source
# File lib/test/unit/assertions.rb, line 54
def build_message(user_message, template_message, *args)    # 2009-06-01
  self.class.tu_deprecation_warning :build_message
  user_message ||= ''
  user_message += ' ' unless user_message.empty?
  msg = template_message.split(/<\?>/).zip(args.map { |o| o.inspect })
  user_message + msg.join
end