From 29c9bba6019df9b6b2323783766963b65a001d2f Mon Sep 17 00:00:00 2001 From: ryanatball Date: Mon, 20 Jan 2014 14:27:15 -0700 Subject: [PATCH] Make default filter case insensitive We had an issue where for one developer SimpleCov just wouldn't work. Turns out that in his terminal he had cded to c:\... instead of C:\... (Note the lowercase vs capital C). Well Windows happiliy changes the prompt to lowercase. This causes SimpleCov.root to start with a lowercase c:/. And that causes the default filter regex to fail for every file. Making the regex case insensitive solves this problem. May also solve several other issues such as #77. --- lib/simplecov/defaults.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/simplecov/defaults.rb b/lib/simplecov/defaults.rb index 0b951ab6..8d33955e 100644 --- a/lib/simplecov/defaults.rb +++ b/lib/simplecov/defaults.rb @@ -4,7 +4,7 @@ SimpleCov.profiles.define 'root_filter' do # Exclude all files outside of simplecov root add_filter do |src| - !(src.filename =~ /^#{Regexp.escape(SimpleCov.root)}/) + !(src.filename =~ /^#{Regexp.escape(SimpleCov.root)}/i) end end