Skip to content

Commit

Permalink
remove bundler v1 specs
Browse files Browse the repository at this point in the history
  • Loading branch information
kbukum1 committed Oct 15, 2024
1 parent dc19762 commit b8493a1
Showing 1 changed file with 5 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@

let(:dependency_files) { bundler_project_dependency_files("blocked_by_subdep") }

it "only upgrades as far as the subdep allows", :bundler_v1_only do
expect(latest_resolvable_version_details[:version]).to eq(Gem::Version.new("1.1.0"))
end

it "is still able to upgrade to the latest version by upgrading the subdep as well", :bundler_v2_only do
it "is still able to upgrade to the latest version by upgrading the subdep as well" do
expect(latest_resolvable_version_details[:version]).to eq(Gem::Version.new("2.0.0"))
end
end
Expand All @@ -119,44 +115,7 @@
end
end

context "with a Bundler v1 version specified", :bundler_v1_only do
let(:requirement_string) { "~> 1.4.0" }

let(:dependency_files) { bundler_project_dependency_files("bundler_specified") }

its([:version]) { is_expected.to eq(Gem::Version.new("1.4.0")) }

context "when attempting to update Bundler" do
let(:dependency_name) { "bundler" }
let(:dependency_files) { bundler_project_dependency_files("bundler_specified") }

include_context "when stubbing rubygems versions api"

its([:version]) { is_expected.to eq(Gem::Version.new("1.16.3")) }

context "when wrapped in a source block" do
let(:dependency_files) do
bundler_project_dependency_files("bundler_specified_in_source_bundler_specified")
end

its([:version]) { is_expected.to eq(Gem::Version.new("1.16.3")) }
end

context "when required by another dependency" do
let(:gemfile_fixture_name) { "bundler_specified_and_required" }
let(:lockfile_fixture_name) do
"bundler_specified_and_required.lock"
end

it "is nil" do
skip("skipped due to https://github.com/dependabot/dependabot-core/issues/2364")
expect(latest_resolvable_version_details).to be_nil
end
end
end
end

context "with a Bundler v2 version specified", :bundler_v2_only do
context "with a Bundler v2 version specified" do
let(:requirement_string) { "~> 1.4.0" }

let(:dependency_files) { bundler_project_dependency_files("bundler_specified") }
Expand All @@ -175,28 +134,7 @@
end
end

context "with a dependency that requires bundler v1", :bundler_v1_only do
let(:dependency_name) { "guard-bundler" }
let(:requirement_string) { "2.2.1" }

let(:dependency_files) { bundler_project_dependency_files("requires_bundler") }

its([:version]) { is_expected.to eq(Gem::Version.new("2.2.1")) }
end

context "when bundled with v1 and requesting a version that requires bundler v2", :bundler_v1_only do
let(:dependency_name) { "guard-bundler" }
let(:requirement_string) { "~> 3.0.0" }

let(:dependency_files) { bundler_project_dependency_files("requires_bundler") }

it "raises a DependencyFileNotResolvable error" do
expect { latest_resolvable_version_details }
.to raise_error(Dependabot::DependencyFileNotResolvable)
end
end

context "with a dependency that requires bundler v2", :bundler_v2_only do
context "with a dependency that requires bundler v2" do
let(:dependency_name) { "guard-bundler" }
let(:requirement_string) { "3.0.0" }

Expand Down Expand Up @@ -247,11 +185,7 @@

let(:dependency_files) { bundler_project_dependency_files("version_conflict_with_listed_subdep") }

it "does not allow the upgrade", :bundler_v1_only do
expect(latest_resolvable_version_details[:version]).to eq(Gem::Version.new("3.6.0"))
end

it "is still able to upgrade", :bundler_v2_only do
it "is still able to upgrade" do
expect(latest_resolvable_version_details[:version]).to be > Gem::Version.new("3.6.0")
end
end
Expand Down Expand Up @@ -424,11 +358,7 @@
}
end

it "is nil", :bundler_v1_only do
expect(resolver.latest_resolvable_version_details).to be_nil
end

it "still resolves fine if the circular dependency does not cause any conflicts", :bundler_v2_only do
it "still resolves fine if the circular dependency does not cause any conflicts" do
expect(resolver.latest_resolvable_version_details[:version].to_s).to eq("0.0.1")
end
end
Expand Down

0 comments on commit b8493a1

Please sign in to comment.