summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-11-18 23:36:51 +0900
committerKazuhiro NISHIYAMA <znz@users.noreply.github.com>2019-11-19 00:29:10 +0900
commite9992bcab03b1646d18b4a417643273a7bbb6158 (patch)
tree937bb0f2fcd3efa6671bd77eab5f66c906c551dc /spec
parent9067f43c0ae6d42222a0dd2cd55380b11343ddd1 (diff)
Allow unknown if ruby core
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2683
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/version_spec.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/bundler/commands/version_spec.rb b/spec/bundler/commands/version_spec.rb
index 66c7930397..f85ac82a40 100644
--- a/spec/bundler/commands/version_spec.rb
+++ b/spec/bundler/commands/version_spec.rb
@@ -1,6 +1,14 @@
# frozen_string_literal: true
+require_relative '../support/path'
+
RSpec.describe "bundle version" do
+ if Spec::Path.ruby_core?
+ COMMIT_HASH = /unknown|[a-fA-F0-9]{7,}/
+ else
+ COMMIT_HASH = /[a-fA-F0-9]{7,}/
+ end
+
context "with -v" do
it "outputs the version", :bundler => "< 3" do
bundle! "-v"
@@ -28,12 +36,12 @@ RSpec.describe "bundle version" do
context "with version" do
it "outputs the version with build metadata", :bundler => "< 3" do
bundle! "version"
- expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
+ expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/)
end
it "outputs the version with build metadata", :bundler => "3" do
bundle! "version"
- expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
+ expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/)
end
end
end