Skip to content

Commit e0818ac

Browse files
committed
Fix stripping features from the description
1 parent a6914c0 commit e0818ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spec/ruby/command_line/dash_v_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
describe "when used alone" do
88
it "prints version and ends" do
9-
ruby_exe(nil, args: '-v').sub("+PRISM ", "").should include(RUBY_DESCRIPTION.sub("+PRISM ", ""))
9+
ruby_exe(nil, args: '-v').gsub("+PRISM ", "").should include(RUBY_DESCRIPTION.gsub("+PRISM ", ""))
1010
end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
1111
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) ||
1212
(ENV['RUBY_GC_LIBRARY'] && ENV['RUBY_GC_LIBRARY'].length > 0) ||

spec/ruby/command_line/rubyopt_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
guard -> { RbConfig::CONFIG["CROSS_COMPILING"] != "yes" } do
2626
it "prints the version number for '-v'" do
2727
ENV["RUBYOPT"] = '-v'
28-
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")
28+
ruby_exe("")[/\A.*/].gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "").should == RUBY_DESCRIPTION.gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "")
2929
end
3030

3131
it "ignores whitespace around the option" do
3232
ENV["RUBYOPT"] = ' -v '
33-
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")
33+
ruby_exe("")[/\A.*/].gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "").should == RUBY_DESCRIPTION.gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "")
3434
end
3535
end
3636

0 commit comments

Comments
 (0)