Permalink
Browse files

If guessing the test framework from terminal command fails, try const…

…ants
  • Loading branch information...
1 parent 6aeec4b commit 37afca54ef503c33d888e910f950b3b943cb9a6c @colszowka committed Nov 1, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/simplecov/command_guesser.rb
View
9 lib/simplecov/command_guesser.rb
@@ -15,7 +15,14 @@ def self.guess(command)
when /spec/
"RSpec"
else
- return command
+ # If the command regexps fail, let's try checking defined constants.
+ if defined?(RSpec)
+ return "RSpec"
+ elsif defined?(Test::Unit)
+ return "Unit Tests"
+ else
+ return command
+ end
end
end
end

0 comments on commit 37afca5

Please sign in to comment.