+1

On May 1, 2009, at 1:33 PM, Brice Figureau wrote:

>
> On ruby 1.8.7 file.close! nils the internal file path.
> So the following pattern:
> file = temp
> file.close!
> file = file.path
> doesn't work.
>
> Signed-off-by: Brice Figureau <[email protected]>
> ---
> spec/integration/util/file_locking.rb |    3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/spec/integration/util/file_locking.rb b/spec/ 
> integration/util/file_locking.rb
> index 680b3d1..e584f9e 100755
> --- a/spec/integration/util/file_locking.rb
> +++ b/spec/integration/util/file_locking.rb
> @@ -7,8 +7,9 @@ require 'puppet/util/file_locking'
> describe Puppet::Util::FileLocking do
>     it "should be able to keep file corruption from happening when  
> there are multiple writers" do
>         file = Tempfile.new("puppetspec")
> +        filepath = file.path
>         file.close!()
> -        file = file.path
> +        file = filepath
>         data = {:a => :b, :c => "A string", :d => "another  
> string", :e => %w{an array of strings}}
>         File.open(file, "w") { |f| f.puts YAML.dump(data) }
>
> -- 
> 1.6.0.2
>
>
> >


-- 
The Ninety-Ninety Rule of Project Schedules:
     The first 90% of the task takes 90% of the time, and the last
     10% takes the other 90%.
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to