summaryrefslogtreecommitdiff
path: root/spec/unit/application/solo_spec.rb
diff options
context:
space:
mode:
authorEmmanuel Iturbide <e.emmanuel@sap.com>2015-06-26 00:45:27 +0200
committerDeWaRs1206 <e.emmanuel@sap.com>2015-06-29 11:42:54 +0200
commit2794dbc54caf022830735cd29f2b9230190baad6 (patch)
tree97abf3f6fd4743d2427a251d7f535af40917ae66 /spec/unit/application/solo_spec.rb
parentdf7db9caca359ce88027a530bece3ff7b6fb92ed (diff)
downloadchef-2794dbc54caf022830735cd29f2b9230190baad6.tar.gz
fix solo_spec according previous change
Diffstat (limited to 'spec/unit/application/solo_spec.rb')
-rw-r--r--spec/unit/application/solo_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb
index 1785ecfc86..cdb20b7435 100644
--- a/spec/unit/application/solo_spec.rb
+++ b/spec/unit/application/solo_spec.rb
@@ -106,6 +106,8 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
describe "when the recipe_url configuration option is specified" do
let(:tarfile) { StringIO.new("remote_tarball_content") }
let(:target_file) { StringIO.new }
+ let(:shellout) { double(run_command: nil, error!: nil, stdout: '') }
+
before do
Chef::Config[:cookbook_path] = "#{Dir.tmpdir}/chef-solo/cookbooks"
@@ -117,7 +119,7 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
allow(app).to receive(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(tarfile)
allow(File).to receive(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(target_file)
- allow(Chef::Mixin::Command).to receive(:run_command).and_return(true)
+ allow(Mixlib::ShellOut).to receive(:new).and_return(shellout)
end
it "should create the recipes path based on the parent of the cookbook path" do
@@ -136,7 +138,7 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
end
it "should untar the target file to the parent of the cookbook path" do
- expect(Chef::Mixin::Command).to receive(:run_command).with({:command => "tar zxvf #{Dir.tmpdir}/chef-solo/recipes.tgz -C #{Dir.tmpdir}/chef-solo"}).and_return(true)
+ expect(Mixlib::ShellOut).to receive(:new).with("tar zxvf #{Dir.tmpdir}/chef-solo/recipes.tgz -C #{Dir.tmpdir}/chef-solo")
app.reconfigure
end
end