summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXabier de Zuazo <xabier@onddo.com>2014-12-03 06:38:26 +0100
committerLamont Granquist <lamont@scriptkiddie.org>2015-01-27 12:04:44 -0800
commite07b1d2a1c7e75ad0a395e2380bf6618f2aa559f (patch)
tree94261b293d39639fe92c1422deb2bfe6b917b41d
parent5f09a024610dd5ed992faa42624beced6f6e3ed3 (diff)
downloadchef-e07b1d2a1c7e75ad0a395e2380bf6618f2aa559f.tar.gz
Provider::User: remove gecos#force_encoding existence check (ruby 1.8 specific, issue #2497)
-rw-r--r--lib/chef/provider/user.rb2
-rw-r--r--spec/unit/provider/user_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/user.rb b/lib/chef/provider/user.rb
index e554dc7f2f..f6ac72448e 100644
--- a/lib/chef/provider/user.rb
+++ b/lib/chef/provider/user.rb
@@ -67,7 +67,7 @@ class Chef
@current_resource.shell(user_info.shell)
@current_resource.password(user_info.passwd)
- if @new_resource.comment && user_info.gecos.respond_to?(:force_encoding)
+ if @new_resource.comment
user_info.gecos.force_encoding(@new_resource.comment.encoding)
end
@current_resource.comment(user_info.gecos)
diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb
index 44434794e7..381168647b 100644
--- a/spec/unit/provider/user_spec.rb
+++ b/spec/unit/provider/user_spec.rb
@@ -91,7 +91,7 @@ describe Chef::Provider::User do
expect(@current_resource.username).to eq(@new_resource.username)
end
- it "should change the encoding of gecos to the encoding of the new resource", :ruby_gte_19_only do
+ it "should change the encoding of gecos to the encoding of the new resource" do
@pw_user.gecos.force_encoding('ASCII-8BIT')
@provider.load_current_resource
expect(@provider.current_resource.comment.encoding).to eq(@new_resource.comment.encoding)