1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Allow unknown if ruby core

This commit is contained in:
Kazuhiro NISHIYAMA 2019-11-18 23:36:51 +09:00 committed by Kazuhiro NISHIYAMA
parent 9067f43c0a
commit e9992bcab0
Notes: git 2019-11-19 00:29:33 +09:00

View file

@ -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