diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-10 16:07:59 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-11 10:15:22 -0700 |
commit | df54458a93fb1ec8d3564aa4e17857b6fa78fe7e (patch) | |
tree | d5877235db406ed589f8d8861f2f64afb7aec7f0 /spec | |
parent | c6b670216c6e011e0007a934decdc003a318405b (diff) | |
download | gitlab-ce-df54458a93fb1ec8d3564aa4e17857b6fa78fe7e.tar.gz |
Truncate filenames created by bin/changelog to 140 characters
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bin/changelog_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/bin/changelog_spec.rb b/spec/bin/changelog_spec.rb index f278043028f..9dc4edf97d1 100644 --- a/spec/bin/changelog_spec.rb +++ b/spec/bin/changelog_spec.rb @@ -3,6 +3,20 @@ require 'spec_helper' load File.expand_path('../../bin/changelog', __dir__) describe 'bin/changelog' do + let(:options) { OpenStruct.new(title: 'Test title', type: 'fixed', dry_run: true) } + + describe ChangelogEntry do + it 'truncates the file path' do + entry = described_class.new(options) + + allow(entry).to receive(:ee?).and_return(false) + allow(entry).to receive(:branch_name).and_return('long-branch-' * 100) + + file_path = entry.send(:file_path) + expect(file_path.length).to eq(140) + end + end + describe ChangelogOptionParser do describe '.parse' do it 'parses --amend' do |