summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/passwd_spec.rb
diff options
context:
space:
mode:
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"]