diff --git a/bundler/lib/dependabot/bundler/helpers.rb b/bundler/lib/dependabot/bundler/helpers.rb index f72f91fcb0..f477e0e881 100644 --- a/bundler/lib/dependabot/bundler/helpers.rb +++ b/bundler/lib/dependabot/bundler/helpers.rb @@ -30,9 +30,9 @@ def self.detected_bundler_version(lockfile) return "unknown" unless lockfile if (matches = lockfile.content.match(BUNDLER_MAJOR_VERSION_REGEX)) - matches[:version] + matches[:version].to_i.to_s else - "1" + "unspecified" end end end diff --git a/bundler/spec/dependabot/bundler/helper_spec.rb b/bundler/spec/dependabot/bundler/helper_spec.rb index b016c846ca..7f165ebe85 100644 --- a/bundler/spec/dependabot/bundler/helper_spec.rb +++ b/bundler/spec/dependabot/bundler/helper_spec.rb @@ -76,8 +76,8 @@ def described_method(lockfile) expect(described_method(no_lockfile)).to eql("unknown") end - it "is 1 if there is no bundled with string" do - expect(described_method(lockfile_bundled_with_missing)).to eql("1") + it "is unspecified if there is no bundled with string" do + expect(described_method(lockfile_bundled_with_missing)).to eql("unspecified") end it "is 1 if it was bundled with a v1.x version" do @@ -88,7 +88,7 @@ def described_method(lockfile) expect(described_method(lockfile_bundled_with_v2)).to eql("2") end - it "is 1 if it was bundled with a future version" do + it "reports the version if it was bundled with a future version" do expect(described_method(lockfile_bundled_with_future_version)).to eql("3") end end