summary refs log tree commit
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2017-05-16 17:08:02 -0400
committerGitHub <noreply@github.com>2017-05-16 17:08:02 -0400
commitc6eae80c351800fbebe022c66083eb43151750b1 (patch)
treeacbf5d682cc222cd42ff3c7b3dfc97c43c5a8339
parent51e8891e4807495d972fcba9832c4fdb30d37b50 (diff)
parentb62cd8a33032107e181286c33d8e385111d8e49d (diff)
downloadrack-c6eae80c351800fbebe022c66083eb43151750b1.tar.gz
Merge pull request #1169 from eileencodes/fix-mistake-in-encoding-change
Fix mistake in encoding change
-rw-r--r--lib/rack/mock.rb2
-rw-r--r--test/spec_mock.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/rack/mock.rb b/lib/rack/mock.rb
index 6a0b7208..1a1add2f 100644
--- a/lib/rack/mock.rb
+++ b/lib/rack/mock.rb
@@ -143,7 +143,7 @@ module Rack
       env
     end
 
-    if "<3".respond_to? :encoding
+    if "<3".respond_to? :b
       def self.env_with_encoding(env, opts, uri)
         env[REQUEST_METHOD] = (opts[:method] ? opts[:method].to_s.upcase : "GET").b
         env["SERVER_NAME"] = (uri.host || "example.org").b
diff --git a/test/spec_mock.rb b/test/spec_mock.rb
index 1bb22974..8132e9b3 100644
--- a/test/spec_mock.rb
+++ b/test/spec_mock.rb
@@ -212,7 +212,7 @@ describe Rack::MockRequest do
     called.should.equal true
   end
 
-  unless "<3".respond_to? :encoding
+  if "<3".respond_to? :b
     should "defaults encoding to ASCII 8BIT" do
       req = Rack::MockRequest.env_for("/foo")