Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stub encoding APIs if not available

  • Loading branch information...
commit bd79255b9c19195179872c308fe60d08ad84cc6a 1 parent 5cb6de6
@pietern pietern authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/reader_test.rb
View
21 test/reader_test.rb
@@ -5,6 +5,27 @@
require File.expand_path('../../lib/hiredis/ext/reader', __FILE__) unless RUBY_PLATFORM =~ /java/
require File.expand_path('../../lib/hiredis/ruby/reader', __FILE__)
+unless defined?(Encoding)
+
+ # Stub encoding APIs if not available
+
+ class String
+ def force_encoding(encoding)
+ self
+ end
+ end
+
+ class Encoding
+ class << self
+ attr_accessor :default_external
+
+ def find(encoding)
+ nil
+ end
+ end
+ end
+end
+
module ReaderTests
def silent
Please sign in to comment.
Something went wrong with that request. Please try again.