ruby-changes:58829
From: Kazuhiro <ko1@a...>
Date: Tue, 19 Nov 2019 00:39:41 +0900 (JST)
Subject: [ruby-changes:58829] e9992bcab0 (master): Allow unknown if ruby core
https://git.ruby-lang.org/ruby.git/commit/?id=e9992bcab0 From e9992bcab03b1646d18b4a417643273a7bbb6158 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Mon, 18 Nov 2019 23:36:51 +0900 Subject: Allow unknown if ruby core diff --git a/spec/bundler/commands/version_spec.rb b/spec/bundler/commands/version_spec.rb index 66c7930..f85ac82 100644 --- a/spec/bundler/commands/version_spec.rb +++ b/spec/bundler/commands/version_spec.rb @@ -1,6 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/version_spec.rb#L1 # 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/version_spec.rb#L36 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/