Skip to content

Commit e9992bc

Browse files
committed
Allow unknown if ruby core
1 parent 9067f43 commit e9992bc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

spec/bundler/commands/version_spec.rb

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# frozen_string_literal: true
22

3+
require_relative '../support/path'
4+
35
RSpec.describe "bundle version" do
6+
if Spec::Path.ruby_core?
7+
COMMIT_HASH = /unknown|[a-fA-F0-9]{7,}/
8+
else
9+
COMMIT_HASH = /[a-fA-F0-9]{7,}/
10+
end
11+
412
context "with -v" do
513
it "outputs the version", :bundler => "< 3" do
614
bundle! "-v"
@@ -28,12 +36,12 @@
2836
context "with version" do
2937
it "outputs the version with build metadata", :bundler => "< 3" do
3038
bundle! "version"
31-
expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
39+
expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/)
3240
end
3341

3442
it "outputs the version with build metadata", :bundler => "3" do
3543
bundle! "version"
36-
expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
44+
expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/)
3745
end
3846
end
3947
end

0 commit comments

Comments
 (0)