summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2019-11-18 23:36:51 +0900
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-22 18:40:01 +0100
commit5934ff15b95be32e3ffc560622a07b27b3c82277 (patch)
tree32c4c34af053b17e0e1152fe6cf4697513cab3a3
parenta11c104c5b6222c018248b585cca2a4f340a9a71 (diff)
downloadbundler-5934ff15b95be32e3ffc560622a07b27b3c82277.tar.gz
Allow unknown if ruby core
-rw-r--r--spec/commands/version_spec.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/commands/version_spec.rb b/spec/commands/version_spec.rb
index 66c7930397..f85ac82a40 100644
--- a/spec/commands/version_spec.rb
+++ b/spec/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