diff options
Diffstat (limited to 'spec/tooling/danger/project_helper_spec.rb')
-rw-r--r-- | spec/tooling/danger/project_helper_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/tooling/danger/project_helper_spec.rb b/spec/tooling/danger/project_helper_spec.rb index c7715eb43fc..5edd9e54cc5 100644 --- a/spec/tooling/danger/project_helper_spec.rb +++ b/spec/tooling/danger/project_helper_spec.rb @@ -93,6 +93,9 @@ RSpec.describe Tooling::Danger::ProjectHelper do 'ee/spec/foo' | [:backend] 'ee/spec/foo/bar' | [:backend] + 'spec/migrations/foo' | [:database] + 'ee/spec/migrations/foo' | [:database] + 'spec/features/foo' | [:test] 'ee/spec/features/foo' | [:test] 'spec/support/shared_examples/features/foo' | [:test] @@ -277,4 +280,17 @@ RSpec.describe Tooling::Danger::ProjectHelper do is_expected.to eq('gitlab-foss') end end + + describe '#file_lines' do + let(:filename) { 'spec/foo_spec.rb' } + let(:file_spy) { spy } + + it 'returns the chomped file lines' do + expect(project_helper).to receive(:read_file).with(filename).and_return(file_spy) + + project_helper.file_lines(filename) + + expect(file_spy).to have_received(:lines).with(chomp: true) + end + end end |