summaryrefslogtreecommitdiff
path: root/spec/unit/provider/group/dscl_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/group/dscl_spec.rb')
-rw-r--r--spec/unit/provider/group/dscl_spec.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/spec/unit/provider/group/dscl_spec.rb b/spec/unit/provider/group/dscl_spec.rb
index acd1ba3859..d84e4e1d57 100644
--- a/spec/unit/provider/group/dscl_spec.rb
+++ b/spec/unit/provider/group/dscl_spec.rb
@@ -27,16 +27,13 @@ describe Chef::Provider::Group::Dscl do
@current_resource = Chef::Resource::Group.new("aj")
@provider = Chef::Provider::Group::Dscl.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @status = double("Process::Status", :exitstatus => 0)
- @pid = 2342
- @stdin = StringIO.new
- @stdout = StringIO.new("\n")
- @stderr = StringIO.new("")
- allow(@provider).to receive(:popen4).and_yield(@pid,@stdin,@stdout,@stderr).and_return(@status)
+
+ @status = double(:stdout => "\n", :stderr => "", :exitstatus => 0)
+ allow(@provider).to receive(:shell_out).and_return(@status)
end
- it "should run popen4 with the supplied array of arguments appended to the dscl command" do
- expect(@provider).to receive(:popen4).with("dscl . -cmd /Path arg1 arg2")
+ it "should run shell_out with the supplied array of arguments appended to the dscl command" do
+ expect(@provider).to receive(:shell_out).with("dscl . -cmd /Path arg1 arg2")
@provider.dscl("cmd", "/Path", "arg1", "arg2")
end
@@ -129,15 +126,15 @@ describe Chef::Provider::Group::Dscl do
end
it "should return true for a used gid number" do
- expect(@provider.gid_used?(500)).to be_true
+ expect(@provider.gid_used?(500)).to be_truthy
end
it "should return false for an unused gid number" do
- expect(@provider.gid_used?(501)).to be_false
+ expect(@provider.gid_used?(501)).to be_falsey
end
it "should return false if not given any valid gid number" do
- expect(@provider.gid_used?(nil)).to be_false
+ expect(@provider.gid_used?(nil)).to be_falsey
end
end