summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorhituzi no sippo <dev@hituzi-no-sippo.me>2025-12-13 15:53:10 +0900
committergit <svn-admin@ruby-lang.org>2025-12-16 03:56:22 +0000
commitf3b9509b52bbf845d95bf799d76dad41783919e5 (patch)
tree671885946a96bf5eb95754d418f48a8d43a391d0 /spec
parent3b50f4ba41ececd01dcf2e35c4071495f250d609 (diff)
[ruby/rubygems] Fix quote handling in mise format ruby version parsing
The previous regex didn't properly match quoted strings it would capture the opening quote as part of the version if quotes were mismatched. This change properly parses double-quoted, single-quoted, and unquoted version strings separately. https://github.com/ruby/rubygems/commit/81e48c8185
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundler/ruby_dsl_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/bundler/bundler/ruby_dsl_spec.rb b/spec/bundler/bundler/ruby_dsl_spec.rb
index 4ef0296695..45a37c5795 100644
--- a/spec/bundler/bundler/ruby_dsl_spec.rb
+++ b/spec/bundler/bundler/ruby_dsl_spec.rb
@@ -193,6 +193,19 @@ RSpec.describe Bundler::RubyDsl do
it_behaves_like "it stores the ruby version"
end
+
+ context "with mismatched quotes" do
+ let(:file_content) do
+ <<~TOML
+ [tools]
+ ruby = "#{version}'
+ TOML
+ end
+
+ it "raises an error" do
+ expect { subject }.to raise_error(Bundler::InvalidArgumentError, "= is not a valid requirement on the Ruby version")
+ end
+ end
end
context "with a .tool-versions file format" do