lib/testrbl.rb in testrbl-0.1.16 vs lib/testrbl.rb in testrbl-0.1.17
- old
+ new
@@ -1,12 +1,12 @@
require 'testrbl/version'
module Testrbl
PATTERNS = [
- /^(\s+)(should|test|it)\s+['"](.*)['"]\s+do\s*$/,
- /^(\s+)(context)\s+['"]?(.*?)['"]?\s+do\s*$/,
- /^(\s+)def\s+(test_)([a-z_\d]+)\s*$/
+ /^(\s+)(should|test|it)\s+['"](.*)['"]\s+do\s*(?:#.*)?$/,
+ /^(\s+)(context)\s+['"]?(.*?)['"]?\s+do\s*(?:#.*)?$/,
+ /^(\s+)def\s+(test_)([a-z_\d]+)\s*(?:#.*)?$/
]
# copied from minitest
MINITEST_NAME_RE = if RUBY_VERSION >= "1.9"
Regexp.new("[^[[:word:]]]+")
@@ -21,10 +21,10 @@
if file and line
file = localize(file)
run "#{ruby} #{i_test}#{file} -n '/#{pattern_from_file(File.readlines(file), line)}/'"
elsif file
run "#{ruby} #{i_test}#{file}"
- elsif argv.all?{|f| File.file?(f) }
+ elsif argv.all?{|f| File.file?(f) } # testrb has a lot of weird issues vs test-unit, so try to avoid it
run "#{ruby} #{argv.map{|f| "-r #{localize(f)}" }.join(" ")} -e ''"
else # pass though
# no bundle exec: projects with mini and unit-test do not run well via bundle exec testrb
run ["testrb"] + argv
end