mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit/testcase.rb: Added equality checking.
* lib/test/unit/testsuite.rb: Added equality checking. * lib/test/unit/assertions.rb: Fixed a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7fd686ba4
commit
3158b75b0b
4 changed files with 29 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Wed Aug 6 22:58:00 2003 Nathaniel Talbott <ntalbott@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/test/unit/testcase.rb: Added equality checking.
|
||||||
|
* lib/test/unit/testsuite.rb: Added equality checking.
|
||||||
|
* lib/test/unit/assertions.rb: Fixed a warning.
|
||||||
|
|
||||||
Wed Aug 6 17:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Aug 6 17:28:10 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/extmk.rb (extmake): pass LIBPATH to make ruby. [ruby-dev:21137]
|
* ext/extmk.rb (extmake): pass LIBPATH to make ruby. [ruby-dev:21137]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
#
|
#
|
||||||
# Author:: Nathaniel Talbott.
|
# Author:: Nathaniel Talbott.
|
||||||
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
|
||||||
# License:: Ruby license.
|
# License:: Ruby license.
|
||||||
|
|
||||||
require 'test/unit/assertionfailederror'
|
require 'test/unit/assertionfailederror'
|
||||||
|
@ -138,6 +138,12 @@ module Test # :nodoc:
|
||||||
"<#{arg1}> expected to be =~\n" +
|
"<#{arg1}> expected to be =~\n" +
|
||||||
"<#{arg2}>"
|
"<#{arg2}>"
|
||||||
end
|
end
|
||||||
|
pattern = case(pattern)
|
||||||
|
when String
|
||||||
|
Regexp.new(pattern)
|
||||||
|
else
|
||||||
|
pattern
|
||||||
|
end
|
||||||
assert_block(full_message) { string =~ pattern }
|
assert_block(full_message) { string =~ pattern }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
#
|
#
|
||||||
# Author:: Nathaniel Talbott.
|
# Author:: Nathaniel Talbott.
|
||||||
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
|
||||||
# License:: Ruby license.
|
# License:: Ruby license.
|
||||||
|
|
||||||
require 'test/unit/assertions'
|
require 'test/unit/assertions'
|
||||||
|
@ -147,6 +147,13 @@ module Test
|
||||||
def to_s
|
def to_s
|
||||||
name
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# It's handy to be able to compare TestCase instances.
|
||||||
|
def ==(other)
|
||||||
|
return false unless(other.kind_of?(self.class))
|
||||||
|
return false unless(@method_name == other.method_name)
|
||||||
|
self.class == other.class
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
#
|
#
|
||||||
# Author:: Nathaniel Talbott.
|
# Author:: Nathaniel Talbott.
|
||||||
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved.
|
||||||
# License:: Ruby license.
|
# License:: Ruby license.
|
||||||
|
|
||||||
module Test
|
module Test
|
||||||
|
@ -59,6 +59,13 @@ module Test
|
||||||
def to_s
|
def to_s
|
||||||
@name
|
@name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# It's handy to be able to compare TestSuite instances.
|
||||||
|
def ==(other)
|
||||||
|
return false unless(other.kind_of?(self.class))
|
||||||
|
return false unless(@name == other.name)
|
||||||
|
@tests == other.tests
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue