Commit c11d3c57 authored by Robert Speicher's avatar Robert Speicher

Remove param from CommitRange#to_s

parent 81a21e57
...@@ -67,12 +67,8 @@ class CommitRange ...@@ -67,12 +67,8 @@ class CommitRange
end end
end end
def to_s(short: true) def to_s
if short "#{sha_from[0..7]}#{notation}#{sha_to[0..7]}"
"#{sha_from[0..7]}#{notation}#{sha_to[0..7]}"
else
"#{sha_from}#{notation}#{sha_to}"
end
end end
# Returns a String for use in a link's title attribute # Returns a String for use in a link's title attribute
......
...@@ -39,24 +39,12 @@ describe CommitRange do ...@@ -39,24 +39,12 @@ describe CommitRange do
end end
describe '#to_s' do describe '#to_s' do
context 'with short IDs' do it 'is correct for three-dot syntax' do
it 'is correct for three-dot syntax' do expect(range.to_s).to eq "#{sha_from[0..7]}...#{sha_to[0..7]}"
expect(range.to_s).to eq "#{sha_from[0..7]}...#{sha_to[0..7]}"
end
it 'is correct for two-dot syntax' do
expect(range2.to_s).to eq "#{sha_from[0..7]}..#{sha_to[0..7]}"
end
end end
context 'with full IDs' do it 'is correct for two-dot syntax' do
it 'is correct for three-dot syntax' do expect(range2.to_s).to eq "#{sha_from[0..7]}..#{sha_to[0..7]}"
expect(range.to_s(short: false)).to eq "#{sha_from}...#{sha_to}"
end
it 'is correct for two-dot syntax' do
expect(range2.to_s(short: false)).to eq "#{sha_from}..#{sha_to}"
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment