features/support/command_line.rb in mirage-3.0.4 vs features/support/command_line.rb in mirage-3.0.5

- old
+ new

@@ -14,9 +14,20 @@ end def normalise text text.gsub(/[\n]/, ' ').gsub(/\s+/, ' ').strip end + + def write_to_file file_path, content + file_path = "#{SCRATCH}/#{file_path}" unless file_path =~ /^\// + + FileUtils.rm_rf(file_path) if File.exists?(file_path) + FileUtils.mkdir_p(File.dirname(file_path)) + + File.open("#{file_path}", 'w') do |file| + file.write(content) + end + end end World CommandLine include CommandLine \ No newline at end of file