global

def expected_encoding?

check for string encoding.
Depends on chaining :with_same_encoding for it to
def expected_encoding?
  if defined?(@expect_same_encoding) && @expect_same_encoding
    actual.encoding == expected.encoding
  else
    true
  end
end