For the moment I have done this:

def Process.fork(&block)
  block.call
end

So that Process.fork doesn't actually spawn a new process but just runs it in 
the current one.

But any better suggestions are welcome :)


Mvh
Morten Møller Riis



On Dec 5, 2011, at 1:04 PM, Morten Møller Riis wrote:

> Hi folks
> 
> How would you spec something like this:
> 
>    as_user username do
>      FileUtils.chmod_R 0755, "#{directory}/*"
>    end
> 
> Where as_user fires off a new process (and set uid to username).
> 
> It seems that this won't catch FileUtils.chmod_R:
> 
> FileUtils.should_receive(:chmod_R).with(0755, "#{@domain.directory}/*")
> 
> I guess that is because it is passed in the block and fired off in a seperate 
> process (Process.fork).
> 
> 
> Mvh
> Morten Møller Riis
> 
> 
> 

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to