You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-ruby/fast_xs/files/fast_xs-0.8.0+ruby-1.9.patch

24 lines
1.1 KiB

Index: fast_xs-0.8.0/test/test_erb_util_module_overrides.rb
===================================================================
--- fast_xs-0.8.0.orig/test/test_erb_util_module_overrides.rb
+++ fast_xs-0.8.0/test/test_erb_util_module_overrides.rb
@@ -35,11 +35,13 @@ class TestErbUtilModuleOverrides < Test:
def test_preserve_encoding
foo = "foo"
- foo.force_encoding Encoding::US_ASCII
- assert_equal Encoding::US_ASCII, url_encode(foo).encoding
- assert_equal Encoding::US_ASCII, html_escape(foo).encoding
- assert_equal Encoding::US_ASCII, u(foo).encoding
- assert_equal Encoding::US_ASCII, h(foo).encoding
+ ascii_encoding = (RUBY_VERSION =~ /1\.9/) ? Encoding::ASCII_8BIT : Encoding::US_ASCII
+
+ foo.force_encoding ascii_encoding
+ assert_equal ascii_encoding, url_encode(foo).encoding
+ assert_equal ascii_encoding, html_escape(foo).encoding
+ assert_equal ascii_encoding, u(foo).encoding
+ assert_equal ascii_encoding, h(foo).encoding
foo.force_encoding Encoding::BINARY
assert_equal Encoding::BINARY, url_encode(foo).encoding