spec/support/view_definition_helpers.rb in scenic-0.2.1 vs spec/support/view_definition_helpers.rb in scenic-0.3.0
- old
+ new
@@ -1,9 +1,10 @@
module ViewDefinitionHelpers
def with_view_definition(name, version, schema)
definition = Scenic::Definition.new(name, version)
+ FileUtils.mkdir_p(File.dirname(definition.full_path))
File.open(definition.full_path, "w") { |f| f.write(schema) }
yield
ensure
- File.delete definition.full_path
+ FileUtils.rm_f(definition.full_path)
end
end