Commit d21c3938 authored by Serdar Sutay's avatar Serdar Sutay
Browse files

Merge pull request #1143 from opscode/windows-spec-fixes

Windows Spec Fixes
parents 15c9dd19 a84bf1ed
......@@ -160,7 +160,7 @@ class Chef
# === Returns
# boolean:: Return value from #do_run. Should always returns true.
def run
if(Chef::Config[:client_fork] && Process.respond_to?(:fork))
if(Chef::Config[:client_fork] && Process.respond_to?(:fork) && !Chef::Platform.windows?)
Chef::Log.info "Forking chef instance to converge..."
pid = fork do
Chef::Log.info "Forked instance now converging"
......
......@@ -336,7 +336,7 @@ class Chef
tempfile = stream_to_tempfile(url, r, &block)
yield tempfile
ensure
tempfile.close!
tempfile && tempfile.close!
end
else
tempfile = stream_to_tempfile(url, r)
......
......@@ -128,7 +128,7 @@ shared_examples_for Chef::Client do
@client.should_receive(:run_started)
@client.should_receive(:run_completed_successfully)
if(Chef::Config[:client_fork])
if(Chef::Config[:client_fork] && !windows?)
require 'stringio'
if(Chef::Config[:pipe_node])
pipe_sim = StringIO.new
......
......@@ -602,6 +602,9 @@ describe Chef::REST do
end
it "passes the original block to the redirected request" do
tempfile = mock("die", :path => "/tmp/ragefist", :close => true, :binmode => nil)
tempfile.should_receive(:close!).at_least(2).times
Tempfile.stub!(:new).with("chef-rest").and_return(tempfile)
http_response = Net::HTTPFound.new("1.1", "302", "bob is taking care of that one for me today")
http_response.add_field("location","/that-thing-is-here-now")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment