lib/testrbl.rb in testrbl-0.8.0 vs lib/testrbl.rb in testrbl-0.9.0

- old
+ new

@@ -1,12 +1,12 @@ require 'testrbl/version' module Testrbl PATTERNS = [ - /^(\s+)(should|test|it)\s+['"](.*)['"]\s+do\s*(?:#.*)?$/, - /^(\s+)(context|describe)\s+['"]?(.*?)['"]?\s+do\s*(?:#.*)?$/, - /^(\s+)def\s+(test_)([a-z_\d]+)\s*(?:#.*)?$/ + /^(\s+)(should|test|it)(\s+|\s*\(\s*)['"](.*)['"](\s*\))?\s+do\s*(?:#.*)?$/, + /^(\s+)(context|describe)(\s+|\s*\(\s*)['"]?(.*?)['"]?(\s*\))?\s+do\s*(?:#.*)?$/, + /^(\s+)def(\s+)(test_)([a-z_\d]+)\s*(?:#.*)?$/ ] OPTION_WITH_ARGUMENT = ["-I", "-r", "-n", "--name", "-e", "--exclude", "-s", "--seed"] INTERPOLATION = /\\\#\\\{.*?\\\}/ @@ -152,10 +152,10 @@ end def test_pattern_from_line(line) PATTERNS.each do |r| next unless line =~ r - whitespace, method, test_name = $1, $2, $3 + whitespace, method, test_name = $1, $2, $4 return [whitespace, test_pattern_from_match(method, test_name)] end nil end