Skip to content

Instantly share code, notes, and snippets.

@phiggins
Created March 25, 2014 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phiggins/9755964 to your computer and use it in GitHub Desktop.
Save phiggins/9755964 to your computer and use it in GitHub Desktop.
diff --git a/rspec-support/lib/rspec/support/encoded_string.rb b/rspec-expectations/lib/rspec/expectations/encoded_string.rb
index 654a208..eeb0b16 100644
--- a/rspec-support/lib/rspec/support/encoded_string.rb
+++ b/rspec-expectations/lib/rspec/expectations/encoded_string.rb
@@ -1,5 +1,5 @@
module RSpec
- module Support
+ module Expectations
# @private
class EncodedString
@@ -33,6 +33,7 @@ module RSpec
private
if String.method_defined?(:encoding)
+
def matching_encoding(string)
string.encode(@encoding)
rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment