module RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting
@private
Public Class Methods
@api private Formats a String’s encoding as a human readable string @param value [String] @return [String]
# File rspec-expectations/lib/rspec/matchers/built_in/base_matcher.rb, line 163 def format_encoding(value) "#<Encoding:#{value.encoding.name}>" end
@api private @return [Boolean] True if the actual and expected string encoding are different.
i.e. the failure may be related to encoding differences and the encoding should be shown to the user. false otherwise.
# File rspec-expectations/lib/rspec/matchers/built_in/base_matcher.rb, line 154 def string_encoding_differs? actual.is_a?(String) && expected.is_a?(String) && actual.encoding != expected.encoding end