Skip to content

Commit

Permalink
remove specs related to detecting ruby version since the changes are …
Browse files Browse the repository at this point in the history
…removed
  • Loading branch information
kbukum1 committed Nov 4, 2024
1 parent 56904c0 commit 7765d58
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions bundler/spec/dependabot/bundler/helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,60 +106,4 @@ def described_method(lockfile)
expect(described_method(lockfile_bundled_with_future_version)).to eql("3")
end
end

describe "#ruby_version" do
context "when there is lockfile, no gemfile, and no ruby version file" do
it "returns the Ruby version from the lockfile" do
expect(described_class.ruby_version(no_gemfile, lockfile_with_ruby_version)).to eq("2.7.2")
end
end

context "when there is lockfile, gemfile, and no ruby version file" do
it "returns the Ruby version from the lockfile" do
expect(described_class.ruby_version(gemfile_with_ruby_version, lockfile_with_ruby_version)).to eq("2.7.2")
end
end

context "when there is lockfile, no gemfile, and a ruby version file" do
it "returns the Ruby version from the .ruby-version file" do
allow(described_class).to receive(:ruby_version_from_ruby_version_file).and_return("2.7.1")
expect(described_class.ruby_version(no_gemfile, lockfile_with_ruby_version)).to eq("2.7.1")
end
end

context "when there is lockfile, gemfile, and a ruby version file" do
it "returns the Ruby version from the .ruby-version file" do
allow(described_class).to receive(:ruby_version_from_ruby_version_file).and_return("2.7.1")
expect(described_class.ruby_version(gemfile_with_ruby_version, lockfile_with_ruby_version)).to eq("2.7.1")
end
end

context "when there is no lockfile, but gemfile and a ruby version file" do
it "returns the Ruby version from the .ruby-version file" do
allow(described_class).to receive(:ruby_version_from_ruby_version_file).and_return("2.7.1")
expect(described_class.ruby_version(gemfile_with_ruby_version, no_lockfile)).to eq("2.7.1")
end
end

context "when there is no lockfile, no gemfile, and a ruby version file" do
it "returns the Ruby version from the .ruby-version file" do
allow(described_class).to receive(:ruby_version_from_ruby_version_file).and_return("2.7.1")
expect(described_class.ruby_version(no_gemfile, no_lockfile)).to eq("2.7.1")
end
end

context "when there is no lockfile, gemfile with ruby version, and no ruby version file" do
it "returns the Ruby version from the Gemfile" do
allow(described_class).to receive(:ruby_version_from_ruby_version_file).and_return(nil)
expect(described_class.ruby_version(gemfile_with_ruby_version, no_lockfile)).to eq("3.0.0")
end
end

context "when there is no lockfile, no gemfile, and no ruby version file" do
it "falls back to the current Ruby version" do
allow(described_class).to receive(:ruby_version_from_ruby_version_file).and_return(nil)
expect(described_class.ruby_version(no_gemfile, no_lockfile)).to eq(RUBY_VERSION)
end
end
end
end

0 comments on commit 7765d58

Please sign in to comment.