Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Sanitized any punctuation in a spec/context name to make Test/Spec's …

…command line regex happy. (Basically lets you use any punctuation you want in your spec/context names.)
  • Loading branch information...
commit 95358c845bc8ca422a64fe0692851192006bc59f 1 parent 0e2b816
Lawrence Karnowski authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 Commands/Run focused test.tmCommand
View
4 Commands/Run focused test.tmCommand
@@ -20,6 +20,10 @@ spec = $3 || $4 if lines.find { |line| line =~ /^\s*(specify|it)\s+('(.*)'|
context = $3 || $4 if lines.find { |line| line =~ /^\s*(context|describe)\s+('(.*)'|"(.*)")+\s*(,.+?)?(\{|do)/ }
end
+# sanitize punctuation for Test/Spec command line regex
+spec.gsub!(/[[:punct:]]/, ".")
+context.gsub!(/[[:punct:]]/, ".")
+
puts [spec, context].inspect
if !spec.empty? && !context.empty?
Please sign in to comment.
Something went wrong with that request. Please try again.