Skip to content

Commit

Permalink
dependabot#6017: Address RSpec/ContextWording Rubocop violations. (de…
Browse files Browse the repository at this point in the history
…pendabot#9727)

* dependabot#6017: Address RSpec/ContextWording Rubocop violations.

* dependabot#6017: Address RSpec/ContextWording Rubocop violations.

* dependabot#6017: Address RSpec/ContextWording Rubocop violations.

* dependabot#6017: ignoring stub rubygems compact index, in Shared_context.

* dependabot#6017: resolving conflicts.

* dependabot#6017: Resolving the conflicts.

* Address RSpec/ContextWording Rubocop violations.

* dependabot#6017: Address RSpec/ContextWording Rubocop violations.

* dependabot#6017: Address RSpec/ContextWording Rubocop violations.

* ignoring stub rubygems compact index, in Shared_context.

* resolving conflicts.

* Resolving the conflicts.

* dependabot#6017: Fixing the test failures.

* dependabot#6017: Fixing bundle error.

---------

Co-authored-by: “Thavachelvam <“thavaahariharangit@git.com”>
  • Loading branch information
thavaahariharangit and “Thavachelvam authored May 16, 2024
1 parent 22e6cbe commit 0a333d2
Show file tree
Hide file tree
Showing 230 changed files with 2,261 additions and 2,249 deletions.
15 changes: 13 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,22 @@ RSpec/ContainExactly:
Exclude:
- 'npm_and_yarn/spec/dependabot/npm_and_yarn/update_checker_spec.rb'

# Offense count: 2237
# Offense count: 30
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false
Exclude:
- 'common/spec/dependabot/pull_request_creator/message_builder_spec.rb'
- 'common/spec/dependabot/metadata_finders/base/release_finder_spec.rb'
- 'common/spec/dependabot/metadata_finders/base/changelog_finder_spec.rb'
- 'bundler/spec/dependabot/bundler/file_updater_spec.rb'

# Offense count: 2
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- 'elm/spec/dependabot/elm/update_checker/requirements_updater_spec.rb'
- 'npm_and_yarn/spec/npm_and_yarn_config_spec.rb'

# Offense count: 31
# This cop supports unsafe autocorrection (--autocorrect-all).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "shared_contexts"

RSpec.describe Functions::ConflictingDependencyResolver do
include_context "in a temporary bundler directory"
include_context "when in a temporary bundler directory"

let(:conflicting_dependency_resolver) do
described_class.new(
Expand Down Expand Up @@ -36,7 +36,7 @@
)
end

context "for nested transitive dependencies" do
context "with nested transitive dependencies" do
let(:project_name) { "transitive_blocking" }
let(:dependency_name) { "activesupport" }
let(:target_version) { "6.0.0" }
Expand Down
14 changes: 7 additions & 7 deletions bundler/helpers/v1/spec/functions/dependency_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "shared_contexts"

RSpec.describe Functions::DependencySource do
include_context "in a temporary bundler directory"
include_context "when in a temporary bundler directory"

let(:dependency_source) do
described_class.new(
Expand Down Expand Up @@ -47,7 +47,7 @@
])
end

context "specified as the default source" do
context "with specified as the default source" do
let(:project_name) { "specified_default_source_no_lockfile" }

it "returns all versions from the private source" do
Expand All @@ -59,7 +59,7 @@
end
end

context "that we don't have authentication details for" do
context "when that we don't have authentication details for" do
before do
stub_request(:get, registry_url + "versions")
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -83,7 +83,7 @@
end
end

context "that we have bad authentication details for" do
context "when that we have bad authentication details for" do
before do
stub_request(:get, registry_url + "versions")
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -107,7 +107,7 @@
end
end

context "that bad-requested, but was a private repo" do
context "when that bad-requested, but was a private repo" do
before do
stub_request(:get, registry_url + "versions")
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -130,7 +130,7 @@
end
end

context "that doesn't have details of the gem" do
context "when that doesn't have details of the gem" do
before do
stub_request(:get, gemfury_business_url)
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -152,7 +152,7 @@
it { is_expected.to be_empty }
end

context "that only implements the old Bundler index format..." do
context "when that only implements the old Bundler index format..." do
let(:project_name) { "sidekiq_pro" }
let(:dependency_name) { "sidekiq-pro" }
let(:registry_url) { "https://gems.contribsys.com/" }
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v1/spec/functions/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "shared_contexts"

RSpec.describe Functions::FileParser do
include_context "in a temporary bundler directory"
include_context "when in a temporary bundler directory"

let(:dependency_source) do
described_class.new(
Expand Down
4 changes: 2 additions & 2 deletions bundler/helpers/v1/spec/functions/force_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
require "shared_contexts"

RSpec.describe Functions::ForceUpdater do
include_context "in a temporary bundler directory"
include_context "stub rubygems compact index"
include_context "when in a temporary bundler directory"
include_context "when stub rubygems compact index"

let(:force_updater) do
described_class.new(
Expand Down
6 changes: 3 additions & 3 deletions bundler/helpers/v1/spec/functions/version_resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
require "shared_contexts"

RSpec.describe Functions::VersionResolver do
include_context "in a temporary bundler directory"
include_context "stub rubygems compact index"
include_context "when in a temporary bundler directory"
include_context "when stub rubygems compact index"

let(:version_resolver) do
described_class.new(
Expand Down Expand Up @@ -43,7 +43,7 @@
its([:fetcher]) { is_expected.to eq("Bundler::Fetcher::CompactIndex") }

context "with a private gemserver source" do
include_context "stub rubygems compact index"
include_context "when stub rubygems compact index"

let(:project_name) { "specified_source" }
let(:requirement_string) { ">= 0" }
Expand Down
4 changes: 2 additions & 2 deletions bundler/helpers/v1/spec/shared_contexts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

TMP_DIR_PATH = File.expand_path("../tmp", __dir__)

RSpec.shared_context "in a temporary bundler directory" do
RSpec.shared_context "when in a temporary bundler directory" do
let(:project_name) { "gemfile" }

let(:tmp_path) do
Expand Down Expand Up @@ -34,7 +34,7 @@ def in_tmp_folder(&block)
end
end

RSpec.shared_context "stub rubygems compact index" do
RSpec.shared_context "when stub rubygems compact index" do
include_context "without caching rubygems"

before do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "shared_contexts"

RSpec.describe Functions::ConflictingDependencyResolver do
include_context "in a temporary bundler directory"
include_context "when in a temporary bundler directory"

let(:conflicting_dependency_resolver) do
described_class.new(
Expand Down Expand Up @@ -36,7 +36,7 @@
)
end

context "for nested transitive dependencies" do
context "with nested transitive dependencies" do
let(:project_name) { "transitive_blocking" }
let(:dependency_name) { "activesupport" }
let(:target_version) { "6.0.0" }
Expand Down
14 changes: 7 additions & 7 deletions bundler/helpers/v2/spec/functions/dependency_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "shared_contexts"

RSpec.describe Functions::DependencySource do
include_context "in a temporary bundler directory"
include_context "when in a temporary bundler directory"

let(:dependency_source) do
described_class.new(
Expand Down Expand Up @@ -47,7 +47,7 @@
])
end

context "specified as the default source" do
context "with specified as the default source" do
let(:project_name) { "specified_default_source_no_lockfile" }

it "returns all versions from the private source" do
Expand All @@ -59,7 +59,7 @@
end
end

context "that we don't have authentication details for" do
context "when that we don't have authentication details for" do
before do
stub_request(:get, registry_url + "versions")
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -82,7 +82,7 @@
end
end

context "that we have bad authentication details for" do
context "when that we have bad authentication details for" do
before do
stub_request(:get, registry_url + "versions")
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -105,7 +105,7 @@
end
end

context "that bad-requested, but was a private repo" do
context "when that bad-requested, but was a private repo" do
before do
stub_request(:get, registry_url + "versions")
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -131,7 +131,7 @@
end
end

context "that doesn't have details of the gem" do
context "when that doesn't have details of the gem" do
before do
stub_request(:get, gemfury_business_url)
.with(basic_auth: ["SECRET_CODES", ""])
Expand All @@ -153,7 +153,7 @@
it { is_expected.to be_empty }
end

context "that only implements the old Bundler index format..." do
context "when that only implements the old Bundler index format..." do
let(:project_name) { "sidekiq_pro" }
let(:dependency_name) { "sidekiq-pro" }
let(:registry_url) { "https://gems.contribsys.com/" }
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v2/spec/functions/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "shared_contexts"

RSpec.describe Functions::FileParser do
include_context "in a temporary bundler directory"
include_context "when in a temporary bundler directory"

let(:dependency_source) do
described_class.new(
Expand Down
4 changes: 2 additions & 2 deletions bundler/helpers/v2/spec/functions/force_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
require "shared_contexts"

RSpec.describe Functions::ForceUpdater do
include_context "in a temporary bundler directory"
include_context "stub rubygems compact index"
include_context "when in a temporary bundler directory"
include_context "when stub rubygems compact index"

let(:force_updater) do
described_class.new(
Expand Down
6 changes: 3 additions & 3 deletions bundler/helpers/v2/spec/functions/version_resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
require "shared_contexts"

RSpec.describe Functions::VersionResolver do
include_context "in a temporary bundler directory"
include_context "stub rubygems compact index"
include_context "when in a temporary bundler directory"
include_context "when stub rubygems compact index"

let(:version_resolver) do
described_class.new(
Expand Down Expand Up @@ -52,7 +52,7 @@
its([:fetcher]) { is_expected.to eq("Bundler::Fetcher::CompactIndex") }

context "with a private gemserver source" do
include_context "stub rubygems compact index"
include_context "when stub rubygems compact index"

let(:project_name) { "specified_source" }
let(:requirement_string) { ">= 0" }
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v2/spec/functions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require "shared_contexts"

RSpec.describe Functions do
include_context "in a temporary bundler directory"
include_context "when in a temporary bundler directory"

describe "#jfrog_source" do
let(:project_name) { "jfrog_source" }
Expand Down
4 changes: 2 additions & 2 deletions bundler/helpers/v2/spec/ruby_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
require "shared_contexts"

RSpec.describe BundlerDefinitionRubyVersionPatch do
include_context "in a temporary bundler directory"
include_context "stub rubygems compact index"
include_context "when in a temporary bundler directory"
include_context "when stub rubygems compact index"

let(:project_name) { "ruby_version_implied" }
before do
Expand Down
4 changes: 2 additions & 2 deletions bundler/helpers/v2/spec/shared_contexts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

TMP_DIR_PATH = File.expand_path("../tmp", __dir__)

RSpec.shared_context "in a temporary bundler directory" do
RSpec.shared_context "when in a temporary bundler directory" do
let(:project_name) { "gemfile" }

let(:tmp_path) do
Expand All @@ -27,7 +27,7 @@ def in_tmp_folder(&block)
end
end

RSpec.shared_context "stub rubygems compact index" do
RSpec.shared_context "when stub rubygems compact index" do
before do
# Stub the Rubygems index
stub_request(:get, "https://index.rubygems.org/versions")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
let(:gemfile) { bundler_project_dependency_file("eval_gemfile_gemfile", filename: "Gemfile") }
it { is_expected.to eq(["backend/Gemfile"]) }

context "whose path must be eval-ed" do
context "when whose path must be eval-ed" do
let(:gemfile) { bundler_project_dependency_file("eval_gemfile_absolute", filename: "Gemfile") }

it "raises a helpful error" do
Expand All @@ -34,7 +34,7 @@
end
end

context "that includes a variable" do
context "when that includes a variable" do
let(:gemfile) { bundler_project_dependency_file("eval_gemfile_variable", filename: "Gemfile") }

it "raises a helpful error" do
Expand All @@ -45,7 +45,7 @@
end
end

context "within a group block" do
context "when within a group block" do
let(:gemfile_body) do
"group :development do\neval_gemfile('some_gemfile')\nend"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
let(:gemfile) { bundler_project_dependency_file("imports_gemspec", filename: "Gemfile") }
it { is_expected.to eq([Pathname.new(".")]) }

context "that has a path specified" do
context "when that has a path specified" do
let(:gemfile) { bundler_project_dependency_file("imports_gemspec_from_path", filename: "Gemfile") }

it { is_expected.to eq([Pathname.new("subdir")]) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
let(:gemfile) { bundler_project_dependency_file("path_source", filename: "Gemfile") }
it { is_expected.to eq([Pathname.new("plugins/example")]) }

context "whose path must be eval-ed" do
context "when whose path must be eval-ed" do
let(:gemfile) { bundler_project_dependency_file("path_source_eval", filename: "Gemfile") }

it "raises a helpful error" do
Expand All @@ -54,7 +54,7 @@
it { is_expected.to eq([Pathname.new("nested/plugins/example")]) }
end

context "that is behind a conditional that is false" do
context "when that is behind a conditional that is false" do
let(:gemfile) { bundler_project_dependency_file("path_source_if", filename: "Gemfile") }
it { is_expected.to eq([Pathname.new("plugins/example")]) }
end
Expand Down
Loading

0 comments on commit 0a333d2

Please sign in to comment.