Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/tooling/danger')
-rw-r--r--spec/tooling/danger/project_helper_spec.rb9
-rw-r--r--spec/tooling/danger/specs_spec.rb5
2 files changed, 12 insertions, 2 deletions
diff --git a/spec/tooling/danger/project_helper_spec.rb b/spec/tooling/danger/project_helper_spec.rb
index b3fb592c2e3..78e9c8e9c62 100644
--- a/spec/tooling/danger/project_helper_spec.rb
+++ b/spec/tooling/danger/project_helper_spec.rb
@@ -101,6 +101,15 @@ RSpec.describe Tooling::Danger::ProjectHelper do
'Rakefile' | [:backend]
'FOO_VERSION' | [:backend]
+ 'lib/scripts/bar.rb' | [:backend, :tooling]
+ 'lib/scripts/bar.js' | [:frontend, :tooling]
+ 'scripts/bar.rb' | [:backend, :tooling]
+ 'scripts/bar.js' | [:frontend, :tooling]
+ 'lib/scripts/subdir/bar.rb' | [:backend, :tooling]
+ 'lib/scripts/subdir/bar.js' | [:frontend, :tooling]
+ 'scripts/subdir/bar.rb' | [:backend, :tooling]
+ 'scripts/subdir/bar.js' | [:frontend, :tooling]
+
'Dangerfile' | [:tooling]
'danger/bundle_size/Dangerfile' | [:tooling]
'ee/danger/bundle_size/Dangerfile' | [:tooling]
diff --git a/spec/tooling/danger/specs_spec.rb b/spec/tooling/danger/specs_spec.rb
index b2454960a7b..6c1fbbb903d 100644
--- a/spec/tooling/danger/specs_spec.rb
+++ b/spec/tooling/danger/specs_spec.rb
@@ -118,7 +118,8 @@ RSpec.describe Tooling::Danger::Specs do
"- expect(foo).to match(['bar'])",
"- expect(foo).to match ['bar']",
"- expect(foo).to eq(['bar'])",
- "- expect(foo).to eq ['bar']"
+ "- expect(foo).to eq ['bar']",
+ "+ expect(foo).to eq([])"
] + matching_lines
end
@@ -126,7 +127,7 @@ RSpec.describe Tooling::Danger::Specs do
allow(specs.helper).to receive(:changed_lines).with(filename).and_return(changed_lines)
end
- it 'returns added, modified, and renamed_after files by default' do
+ it 'returns all lines using an array equality matcher' do
expect(specs.added_line_matching_match_with_array(filename)).to match_array(matching_lines)
end
end