Module: Test::Unit::Assertions

Defined in:
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb

Overview

deprecations

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



22
23
24
# File 'lib/test/unit/assertions.rb', line 22

def self.included mod
  mod.send :include, Test::Unit::CRAP_ASSERTIONS
end

Instance Method Details

#assert_nothing_raised(_ = :ignored) ⇒ Object

2009-06-01



37
38
39
40
41
42
43
# File 'lib/test/unit/assertions.rb', line 37

def assert_nothing_raised _ = :ignored                      # 2009-06-01
  self.class.tu_deprecation_warning :assert_nothing_raised
  self._assertions += 1
  yield
rescue => e
  raise Mini::Assertion, exception_details(e, "Exception raised:")
end

#build_message(user_message, template_message, *args) ⇒ Object

2009-06-01



45
46
47
48
49
50
51
# File 'lib/test/unit/assertions.rb', line 45

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