Skip to content

Commit

Permalink
Fix spec path verification with multiple pattern
Browse files Browse the repository at this point in the history
RSpec.configuration.pattern may not satisfy a glob pattern
if multiple pattern is set (e.g. '**{,/*/**}/*_spec.rb,**/*.feature').

See also RSpec::Core::Configuration#file_glob_from.
  • Loading branch information
thedoritos committed Apr 2, 2016
1 parent 7b77566 commit f5492bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/guard/rspec_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def self.spec_path?(path)
path ||= ""
path = path.sub(/:\d+\z/, "")
path = Pathname.new(path).cleanpath.to_s
File.fnmatch(pattern, path, flags)
stripped = "{#{pattern.gsub(/\s*,\s*/, ',')}}"
File.fnmatch(stripped, path, flags)
end

def dump_summary(*args)
Expand Down

0 comments on commit f5492bf

Please sign in to comment.