summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/passwd_spec.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-14 14:26:07 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-14 14:26:07 -0700
commit9a0acef3d6d50c19a75c4bb5159522637297f34a (patch)
tree27452efce8c887e77b7c29d9b3d023dcc2eb0a18 /spec/unit/plugins/passwd_spec.rb
parent0650fb361ae90f067707b3a9cb7f736d104d0650 (diff)
downloadohai-frozen_strings.tar.gz
Some frozen string fixesfrozen_strings
Mostly just switching to String.new, but a bit of refactoring as well. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/plugins/passwd_spec.rb')
-rw-r--r--spec/unit/plugins/passwd_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/unit/plugins/passwd_spec.rb b/spec/unit/plugins/passwd_spec.rb
index bc518c12..2126211f 100644
--- a/spec/unit/plugins/passwd_spec.rb
+++ b/spec/unit/plugins/passwd_spec.rb
@@ -56,7 +56,7 @@ describe Ohai::System, "plugin etc", :unix_only do
if "".respond_to?(:force_encoding)
it "sets the encoding of strings to the default external encoding" do
fields = ["root", 1, 1, "/root", "/bin/zsh", "BOFH"]
- fields.each { |f| f.force_encoding(Encoding::ASCII_8BIT) if f.respond_to?(:force_encoding) }
+ fields.each { |f| f.dup.force_encoding(Encoding::ASCII_8BIT) if f.respond_to?(:force_encoding) }
allow(Etc).to receive(:passwd).and_yield(PasswdEntry.new(*fields))
plugin.run
root = plugin[:etc][:passwd]["root"]