Use FixtureResolver in your tests to simulate the presence of files on the file system. This is used internally by Rails’ own test suite, and is useful for testing extensions that have no way of knowing what the file system will look like at runtime.
# File lib/action_view/testing/resolvers.rb, line 18 18: def query(path, exts, formats) 19: query = Regexp.escape(path) 20: exts.each do |ext| 21: query << '(' << ext.map {|e| e && Regexp.escape(".#{e}") }.join('|') << '|)' 22: end 23: 24: templates = [] 25: @hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source| 26: handler, format = extract_handler_and_format(path, formats) 27: templates << Template.new(source, path, handler, 28: :virtual_path => path, :format => format) 29: end 30: 31: templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size } 32: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.