summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2025-05-08 19:08:11 +0900
committerHiroshi SHIBATA <[email protected]>2025-05-09 14:27:28 +0900
commit8a1d45144bc30aaca67d953521c19c7ee0b378c0 (patch)
treeaa7928bb3f680528b933eb896e8f0760276cd12d /test
parentc66768376815878e9d103e80135b37cb4058fa8b (diff)
Support `require 'cgi/escape'` with extracting CGI::Escape from CGI::Util
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13275
Diffstat (limited to 'test')
-rw-r--r--test/cgi/test_cgi_util.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/cgi/test_cgi_util.rb b/test/cgi/test_cgi_util.rb
index bff77f7ffc..c3e48037e8 100644
--- a/test/cgi/test_cgi_util.rb
+++ b/test/cgi/test_cgi_util.rb
@@ -6,7 +6,7 @@ require_relative 'update_env'
class CGIUtilTest < Test::Unit::TestCase
- include CGI::Util
+ include CGI::Escape
include UpdateEnv
def setup
@@ -63,7 +63,7 @@ class CGIUtilTest < Test::Unit::TestCase
return unless defined?(::Encoding)
assert_raise(TypeError) {CGI.unescape('', nil)}
- assert_separately(%w[-rcgi/util], "#{<<-"begin;"}\n#{<<-"end;"}")
+ assert_separately(%w[-rcgi/escape], "#{<<-"begin;"}\n#{<<-"end;"}")
begin;
assert_equal("", CGI.unescape(''))
end;
@@ -120,7 +120,7 @@ class CGIUtilTest < Test::Unit::TestCase
return unless defined?(::Encoding)
assert_raise(TypeError) {CGI.unescapeURIComponent('', nil)}
- assert_separately(%w[-rcgi/util], "#{<<-"begin;"}\n#{<<-"end;"}")
+ assert_separately(%w[-rcgi/escape], "#{<<-"begin;"}\n#{<<-"end;"}")
begin;
assert_equal("", CGI.unescapeURIComponent(''))
end;
@@ -300,21 +300,21 @@ end
class CGIUtilPureRubyTest < Test::Unit::TestCase
def setup
- CGI::Escape.module_eval do
+ CGI::EscapeExt.module_eval do
alias _escapeHTML escapeHTML
remove_method :escapeHTML
alias _unescapeHTML unescapeHTML
remove_method :unescapeHTML
- end if defined?(CGI::Escape)
+ end if defined?(CGI::EscapeExt)
end
def teardown
- CGI::Escape.module_eval do
+ CGI::EscapeExt.module_eval do
alias escapeHTML _escapeHTML
remove_method :_escapeHTML
alias unescapeHTML _unescapeHTML
remove_method :_unescapeHTML
- end if defined?(CGI::Escape)
+ end if defined?(CGI::EscapeExt)
end
include CGIUtilTest::UnescapeHTMLTests