You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If RSpec.configuration.strict_catalog_encoding is set to true, check whether the
catalog contains binary strings or strings with an invalid encoding. This only
checks resources, not other catalog metadata like `version`, `environment` or
edges.
Binary strings (aka ASCII_8BIT) commonly occur in facts that call
Socket.gethostname, Windows registry or partial file reads.
Strings with invalid encodings commonly occur when calling the `file` function
to inline kerberos key tab files or DER encoded keys. Note this check can't
detect cases where the underlying byte representation happens to be valid for
UTF-8. For example, if a string contains the 3 bytes sequence 0xE2 0x82 0xAC,
String#valid_encoding? will return true, since that happens to correspond to
the € code point. But if the string contains 0xC0, then valid_encoding? will
return false, since C0 must be followed by a second byte in UTF-8.
By default the setting is false, because facter has historically produced facts
with ASCII_8BIT and will be detected when running "puppet apply". The behavior
can be opted into by setting this in your module's spec/spec_helper.rb:
RSpec.configure do |c|
c.strict_catalog_encoding = true
end
0 commit comments