Skip to content

Commit

Permalink
Merge pull request #210 from killphi/fix_run_all_for_spec_helper
Browse files Browse the repository at this point in the history
Fix inspector handling with spec folders
  • Loading branch information
thibaudgg committed Oct 17, 2013
2 parents 00aba6f + d3ce3c4 commit 56cc1b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/guard/rspec/inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _select_only_spec_files(paths)
spec_files = spec_paths.collect { |path| Dir[File.join(path, "**{,/*/**}", "*[_.]spec.rb")] }
feature_files = spec_paths.collect { |path| Dir[File.join(path, "**{,/*/**}", "*.feature")] }
files = (spec_files + feature_files).flatten
paths.select { |p| files.include?(p) }
paths.select { |p| files.include?(p) || spec_paths.include?(p) }
end

end
Expand Down
8 changes: 8 additions & 0 deletions spec/lib/guard/rspec/inspector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
it "returns custom spec paths if no args" do
expect(inspector.paths).to eq %w[custom_spec]
end

it "returns spec path if given as argument" do
expect(inspector.paths(%w[custom_spec])).to eq %w[custom_spec]
end
end

it "returns new paths" do
Expand All @@ -42,6 +46,10 @@
expect(inspector.paths(paths + %w[foo])).to eq paths
end

it "returns spec path if given as argument" do
expect(inspector.paths(%w[spec])).to eq %w[spec]
end

context "with focused paths" do
before {
FileUtils.mkdir_p('tmp')
Expand Down

0 comments on commit 56cc1b5

Please sign in to comment.