lib/mspec/helpers/fs.rb in mspec-1.5.13 vs lib/mspec/helpers/fs.rb in mspec-1.5.14

- old
+ new

@@ -46,13 +46,13 @@ end end # Creates a file +name+. Creates the directory for +name+ # if it does not exist. - def touch(name) + def touch(name, mode="w") mkdir_p File.dirname(name) - File.open(name, "w") do |f| + File.open(name, mode) do |f| yield f if block_given? end end end