summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-05-01 13:12:40 +0200
committerJames Turnbull <james@lovedthanlost.net>2009-05-15 09:56:58 +1000
commit8c718c9f678809ad7bc6a0cc5b5356847a625ca5 (patch)
tree17f8269e63bc1f49df3bec6bcc9b669a309b7e60
parent17f2c7d1255d79a79060ca93f9d73642a804ed10 (diff)
downloadpuppet-8c718c9f678809ad7bc6a0cc5b5356847a625ca5.tar.gz
puppet-8c718c9f678809ad7bc6a0cc5b5356847a625ca5.tar.xz
puppet-8c718c9f678809ad7bc6a0cc5b5356847a625ca5.zip
Fix failing test: file.close! and file.path ordering fix
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 <brice-puppet@daysofwonder.com>
-rwxr-xr-xspec/integration/util/file_locking.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/integration/util/file_locking.rb b/spec/integration/util/file_locking.rb
index 680b3d1ed..e584f9ef1 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) }