Fix stripping features from the description

This commit is contained in:
Nobuyoshi Nakada 2025-07-29 20:22:50 +09:00
parent a6914c089d
commit e0818ac659
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
2 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ describe "The -v command line option" do
describe "when used alone" do describe "when used alone" do
it "prints version and ends" do it "prints version and ends" do
ruby_exe(nil, args: '-v').sub("+PRISM ", "").should include(RUBY_DESCRIPTION.sub("+PRISM ", "")) ruby_exe(nil, args: '-v').gsub("+PRISM ", "").should include(RUBY_DESCRIPTION.gsub("+PRISM ", ""))
end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) || end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) || (defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) ||
(ENV['RUBY_GC_LIBRARY'] && ENV['RUBY_GC_LIBRARY'].length > 0) || (ENV['RUBY_GC_LIBRARY'] && ENV['RUBY_GC_LIBRARY'].length > 0) ||

View file

@ -25,12 +25,12 @@ describe "Processing RUBYOPT" do
guard -> { RbConfig::CONFIG["CROSS_COMPILING"] != "yes" } do guard -> { RbConfig::CONFIG["CROSS_COMPILING"] != "yes" } do
it "prints the version number for '-v'" do it "prints the version number for '-v'" do
ENV["RUBYOPT"] = '-v' ENV["RUBYOPT"] = '-v'
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "") ruby_exe("")[/\A.*/].gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "").should == RUBY_DESCRIPTION.gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "")
end end
it "ignores whitespace around the option" do it "ignores whitespace around the option" do
ENV["RUBYOPT"] = ' -v ' ENV["RUBYOPT"] = ' -v '
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "") ruby_exe("")[/\A.*/].gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "").should == RUBY_DESCRIPTION.gsub(/\s\+(PRISM|GC(\[\w+\])?)(?=\s)/, "")
end end
end end