1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Imported minitest 2.6.2 (r6712)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ryan 2011-10-19 20:34:21 +00:00
parent 9cfc7a658f
commit 9bec8ef50c
8 changed files with 119 additions and 24 deletions

View file

@ -192,10 +192,12 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
# write specs don't like class inheritence, so this goes way out of
# its way to make sure that expectations aren't inherited.
#
# This is also aliased to #specify and doesn't require a +desc+ arg.
#
# Hint: If you _do_ want inheritence, use minitest/unit. You can mix
# and match between assertions and expectations as much as you want.
def self.it desc, &block
def self.it desc = "anonymous", &block
block ||= proc { skip "(no tests defined)" }
@specs ||= 0
@ -240,7 +242,9 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
# :stopdoc:
class << self
attr_reader :name, :desc
attr_reader :desc
alias :specify :it
alias :name :to_s
end
# :startdoc:
end
@ -334,9 +338,13 @@ module MiniTest::Expectations
#
# n.must_be :<=, 42
#
# This can also do predicates:
#
# str.must_be :empty?
#
# :method: must_be
infect_an_assertion :assert_operator, :must_be
infect_an_assertion :assert_operator, :must_be, :reverse
##
# See MiniTest::Assertions#assert_output
@ -491,9 +499,13 @@ module MiniTest::Expectations
#
# n.wont_be :<=, 42
#
# This can also do predicates:
#
# str.wont_be :empty?
#
# :method: wont_be
infect_an_assertion :refute_operator, :wont_be
infect_an_assertion :refute_operator, :wont_be, :reverse
##
# See MiniTest::Assertions#refute_respond_to