class ActionView::FixtureResolver
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.
Public Class Methods
Source
# File lib/action_view/testing/resolvers.rb, line 11 def initialize(hash = {}) super("") @hash = hash @path = "" end
Calls superclass method
ActionView::FileSystemResolver::new
Public Instance Methods
Source
# File lib/action_view/testing/resolvers.rb, line 21 def to_s @hash.keys.join(", ") end
Private Instance Methods
Source
# File lib/action_view/testing/resolvers.rb, line 32 def source_for_template(template) @hash[template.from(1)] end
Source
# File lib/action_view/testing/resolvers.rb, line 26 def template_glob(glob) @hash.keys.filter_map do |path| "/#{path}" if File.fnmatch(glob, path) end end