123456789_123456789_123456789_123456789_123456789_

Module: RSpec::Matchers::BuiltIn::BaseMatcher::StringEncodingFormatting Private

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
::RSpec::Matchers::BuiltIn::All, ::RSpec::Matchers::BuiltIn::BaseMatcher, ::RSpec::Matchers::BuiltIn::Be, ::RSpec::Matchers::BuiltIn::BeAKindOf, ::RSpec::Matchers::BuiltIn::BeAnInstanceOf, ::RSpec::Matchers::BuiltIn::BeBetween, ::RSpec::Matchers::BuiltIn::BeComparedTo, ::RSpec::Matchers::BuiltIn::BeFalsey, ::RSpec::Matchers::BuiltIn::BeNil, ::RSpec::Matchers::BuiltIn::BePredicate, ::RSpec::Matchers::BuiltIn::BeTruthy, ::RSpec::Matchers::BuiltIn::BeWithin, ::RSpec::Matchers::BuiltIn::Change, ::RSpec::Matchers::BuiltIn::ChangeFromValue, ::RSpec::Matchers::BuiltIn::ChangeRelatively, ::RSpec::Matchers::BuiltIn::ChangeToValue, ::RSpec::Matchers::BuiltIn::Compound, ::RSpec::Matchers::BuiltIn::Compound::And, ::RSpec::Matchers::BuiltIn::Compound::Or, ::RSpec::Matchers::BuiltIn::ContainExactly, ::RSpec::Matchers::BuiltIn::Cover, ::RSpec::Matchers::BuiltIn::DynamicPredicate, ::RSpec::Matchers::BuiltIn::EndWith, ::RSpec::Matchers::BuiltIn::Eq, ::RSpec::Matchers::BuiltIn::Eql, ::RSpec::Matchers::BuiltIn::Equal, ::RSpec::Matchers::BuiltIn::Exist, ::RSpec::Matchers::BuiltIn::Has, ::RSpec::Matchers::BuiltIn::HaveAttributes, ::RSpec::Matchers::BuiltIn::Include, ::RSpec::Matchers::BuiltIn::Match, ::RSpec::Matchers::BuiltIn::Output, ::RSpec::Matchers::BuiltIn::RespondTo, ::RSpec::Matchers::BuiltIn::Satisfy, ::RSpec::Matchers::BuiltIn::SpecificValuesChange, ::RSpec::Matchers::BuiltIn::StartOrEndWith, ::RSpec::Matchers::BuiltIn::StartWith, ::RSpec::Matchers::BuiltIn::YieldControl, ::RSpec::Matchers::BuiltIn::YieldSuccessiveArgs, ::RSpec::Matchers::BuiltIn::YieldWithArgs, ::RSpec::Matchers::BuiltIn::YieldWithNoArgs, ::RSpec::Rails::Matchers::ActionCable::HaveBroadcastedTo, ::RSpec::Rails::Matchers::ActionCable::HaveStream, ::RSpec::Rails::Matchers::BeValid
Defined in: rspec-expectations/lib/rspec/matchers/built_in/base_matcher.rb

Class Method Summary

Class Method Details

.format_encoding(_value) ⇒ nil (mod_func)

Formats a String’s encoding as a human readable string

See additional method definition at line 188.

Parameters:

  • _value (String)

Returns:

  • (nil)

    nil as the curent Ruby version does not support String encoding

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/base_matcher.rb', line 196

def format_encoding(value)
  "#<Encoding:#{value.encoding.name}>"
end

.string_encoding_differs?Boolean (mod_func)

Returns:

  • (Boolean)

    False always as the curent Ruby version does not support String encoding

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/base_matcher.rb', line 177

def string_encoding_differs?
  actual.is_a?(String) && expected.is_a?(String) && actual.encoding != expected.encoding
end