mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/test/unit.rb: refactored to use optparse.
* lib/test/unit.rb: added support for selecting the output level from the command-line. * lib/test/unit.rb: added a command-line switch to stop processing the command-line, allowing arguments to be passed to tests. * lib/test/unit.rb: changed the method for specifying a runner or a filter from the command-line. * lib/test/unit/collector/objectspace.rb: fixed a bug causing all tests to be excluded when the filter was set to an empty array. * test/testunit/collector/test_objectspace.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a3ef2d79fa
commit
b0ccb799ec
4 changed files with 111 additions and 29 deletions
|
@ -10,6 +10,7 @@ module Test
|
|||
|
||||
def initialize(source=::ObjectSpace)
|
||||
@source = source
|
||||
@filters = []
|
||||
end
|
||||
|
||||
def collect(name=NAME)
|
||||
|
@ -23,7 +24,7 @@ module Test
|
|||
end
|
||||
|
||||
def include(test)
|
||||
return true unless(@filters)
|
||||
return true if(@filters.empty?)
|
||||
@filters.each do |filter|
|
||||
return true if(filter.call(test))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue