File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
+ require_relative '../support/path'
4
+
3
5
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
+
4
12
context "with -v" do
5
13
it "outputs the version" , :bundler => "< 3" do
6
14
bundle! "-v"
28
36
context "with version" do
29
37
it "outputs the version with build metadata" , :bundler => "< 3" do
30
38
bundle! "version"
31
- expect ( out ) . to match ( /\A Bundler version #{ Regexp . escape ( Bundler ::VERSION ) } \( \d {4}-\d {2}-\d {2} commit [a-fA-F0-9]{7, }\) \z / )
39
+ expect ( out ) . to match ( /\A Bundler version #{ Regexp . escape ( Bundler ::VERSION ) } \( \d {4}-\d {2}-\d {2} commit #{ COMMIT_HASH } \) \z / )
32
40
end
33
41
34
42
it "outputs the version with build metadata" , :bundler => "3" do
35
43
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 / )
37
45
end
38
46
end
39
47
end
You can’t perform that action at this time.
0 commit comments