diff --git a/features/config_command_name.feature b/features/config_command_name.feature index a5b5f76f..2b6b5b34 100644 --- a/features/config_command_name.feature +++ b/features/config_command_name.feature @@ -31,3 +31,15 @@ Feature: Custom names for individual test suites | Dreck macht Speck | | I'm in UR Unitz | + Scenario: RSpec auto detection with spec/features + Given SimpleCov for RSpec is configured with: + """ + require 'simplecov' + SimpleCov.start + """ + And a file named "spec/features/foobar_spec.rb" with: + """ + """ + When I open the coverage report generated with `bundle exec rspec spec` + Then the report should be based upon: + | RSpec | diff --git a/lib/simplecov/command_guesser.rb b/lib/simplecov/command_guesser.rb index 4fb8b1fb..e436b1d0 100644 --- a/lib/simplecov/command_guesser.rb +++ b/lib/simplecov/command_guesser.rb @@ -18,16 +18,16 @@ def guess def from_command_line_options case original_run_command - when /#{'test/functional/'}/, /#{'test/{.*?functional.*?}/'}/ + when /test\/functional\//, /test\/{.*?functional.*?}\// "Functional Tests" - when /#{'test/integration/'}/ + when /test\/integration\// "Integration Tests" - when /#{'test/'}/ + when /test\// "Unit Tests" - when /cucumber/, /features/ - "Cucumber Features" when /spec/ "RSpec" + when /cucumber/, /features/ + "Cucumber Features" else nil end @@ -46,4 +46,4 @@ def from_defined_constants end end end -end \ No newline at end of file +end