summaryrefslogtreecommitdiff
path: root/spec/unit/knife
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-02-27 16:32:40 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-02-27 16:32:40 -0800
commit10a34f79731b1727a2ba747d4a485eb08bc41fa4 (patch)
tree70493fc1d1d5411aceb0a439f7394c376c1a8a1c /spec/unit/knife
parent53da742fbf196bd074411cdf7e6400e6e856119b (diff)
downloadchef-10a34f79731b1727a2ba747d4a485eb08bc41fa4.tar.gz
Update spec to mock out tar_cmd
Diffstat (limited to 'spec/unit/knife')
-rw-r--r--spec/unit/knife/cookbook_site_share_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb
index f7207dd175..76e4ec730e 100644
--- a/spec/unit/knife/cookbook_site_share_spec.rb
+++ b/spec/unit/knife/cookbook_site_share_spec.rb
@@ -144,8 +144,9 @@ describe Chef::Knife::CookbookSiteShare do
end
it "should list files in the tarball" do
- expect(@knife).to receive(:shell_out!).with("tar -czf #{@cookbook.name}.tgz #{@cookbook.name}", {:cwd => "/var/tmp/dummy"})
- expect(@knife).to receive(:shell_out!).with("tar -tzf #{@cookbook.name}.tgz", {:cwd => "/var/tmp/dummy"})
+ allow(@knife).to receive(:tar_cmd).and_return("footar")
+ expect(@knife).to receive(:shell_out!).with("footar -czf #{@cookbook.name}.tgz #{@cookbook.name}", {:cwd => "/var/tmp/dummy"})
+ expect(@knife).to receive(:shell_out!).with("footar -tzf #{@cookbook.name}.tgz", {:cwd => "/var/tmp/dummy"})
@knife.run
end