Remove param from CommitRange#to_s

This commit is contained in:
Robert Speicher 2015-04-23 13:52:35 -04:00
parent 81a21e5796
commit c11d3c5789
2 changed files with 6 additions and 22 deletions

View file

@ -67,12 +67,8 @@ class CommitRange
end
end
def to_s(short: true)
if short
def to_s
"#{sha_from[0..7]}#{notation}#{sha_to[0..7]}"
else
"#{sha_from}#{notation}#{sha_to}"
end
end
# Returns a String for use in a link's title attribute

View file

@ -39,7 +39,6 @@ describe CommitRange do
end
describe '#to_s' do
context 'with short IDs' do
it 'is correct for three-dot syntax' do
expect(range.to_s).to eq "#{sha_from[0..7]}...#{sha_to[0..7]}"
end
@ -49,17 +48,6 @@ describe CommitRange do
end
end
context 'with full IDs' do
it 'is correct for three-dot syntax' do
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
describe '#reference_title' do
it 'returns the correct String' do
expect(range.reference_title).to eq "Commits #{sha_from} through #{sha_to}"