Tweak test formatting; fix order-dependent failure

The order-dependent failure has been been commented in code.

After manually bisecting the test suite, I was able to determine that
the template cascade tests were leaving the `@@template_priority_path`
set to an overridden value in tests run afterward.
This commit is contained in:
benjamin wil
2021-12-31 16:27:58 -08:00
parent 675fff02ac
commit 7a019567ec
2 changed files with 30 additions and 14 deletions
+6 -2
View File
@@ -11,9 +11,13 @@ module Precious
end
def first_path_available(name)
priority = File.join(template_priority_path, "#{name}.#{template_extension}")
default = File.join(template_path, "#{name}.#{template_extension}")
File.exists?(priority) ? priority : default
priority =
if template_priority_path
File.join(template_priority_path, "#{name}.#{template_extension}")
end
priority && File.exists?(priority) ? priority : default
end
# Method should track lib/mustache/settings.rb from Mustache project.