Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Test sorting by pathname and column.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jun 8, 2016
1 parent 0ba94ea commit 84dbedc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby-lint/report/entry_spec.rb
Expand Up @@ -110,5 +110,17 @@
b = RubyLint::Report::Entry.new(:file => 'a.rb', :line => 1)
(a<=>b).should > 0
end

it 'compares whole paths, not basenames' do
a = RubyLint::Report::Entry.new(:file => 'a/b.rb', :line => 2)
b = RubyLint::Report::Entry.new(:file => 'b/a.rb', :line => 1)
(a<=>b).should < 0
end

it 'compares also column numbers' do
a = RubyLint::Report::Entry.new(:file => 'a.rb', :line => 1, :column => 1)
b = RubyLint::Report::Entry.new(:file => 'a.rb', :line => 1, :column => 2)
(a<=>b).should < 0
end
end
end

0 comments on commit 84dbedc

Please sign in to comment.