test/test_cache.rb in cutaneous-0.2.0 vs test/test_cache.rb in cutaneous-0.3.0
- old
+ new
@@ -53,11 +53,11 @@
context = ContextHash(right: "right")
result1 = engine.render("c", context)
# Ensure that the cached script file is being used by overwriting its contents
path = template_path("c", "html", "rb")
- assert ::File.exists?(path), "Template cache should have created '#{path}'"
+ assert ::File.exist?(path), "Template cache should have created '#{path}'"
File.open(path, "w") do |f|
f.write("__buf << 'right'")
end
engine = cached_engine
@@ -76,11 +76,11 @@
now = Time.now
template_path = template_path("c", "html")
script_path = template_path("c", "html", "rb")
- assert ::File.exists?(script_path), "Template cache should have created '#{script_path}'"
+ assert ::File.exist?(script_path), "Template cache should have created '#{script_path}'"
File.open(template_path, "w") { |f| f.write("template") }
File.utime(now, now, template_path)
File.utime(now - 100, now - 100, script_path)
@@ -97,10 +97,10 @@
end
context = ContextHash(right: "right")
result1 = engine.render("c", context)
script_path = template_path("c", "html", "rb")
- refute ::File.exists?(script_path), "Template cache should not have created '#{script_path}'"
+ refute ::File.exist?(script_path), "Template cache should not have created '#{script_path}'"
end
it "doesn't attempt to write a cached script for Proc templates" do
context = ContextHash(right: "right")
result1 = engine.render(Proc.new { "This is ${right}"}, context)