Skip to content

Commit

Permalink
fixed #243, filesnames and lines can be ambigous with shared example …
Browse files Browse the repository at this point in the history
…groups, so make them uniq
  • Loading branch information
slowjack2k committed Jan 8, 2014
1 parent 250a568 commit cc175e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/guard/rspec/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def write(&block)

def _failed_paths
failed = examples.select { |e| e.execution_result[:status] == 'failed' }
failed.map { |e| self.class.extract_spec_location(e.metadata) }
failed.map { |e| self.class.extract_spec_location(e.metadata) }.sort.uniq
end

def _message(example_count, failure_count, pending_count, duration)
Expand Down
6 changes: 6 additions & 0 deletions spec/lib/guard/rspec/formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
end

it 'writes only uniq filenames out' do
allow(formatter).to receive(:examples) { [failed_example, failed_example] }
formatter.dump_summary(123, 3, 1, 0)
expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
end

end

it "should find the spec file for shared examples" do
Expand Down

0 comments on commit cc175e1

Please sign in to comment.