Class: ActionView::FixtureResolver

Inherits:
OptimizedFileSystemResolver show all
Defined in:
lib/action_view/testing/resolvers.rb

Overview

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.

Constant Summary

Constants inherited from PathResolver

PathResolver::DEFAULT_PATTERN, PathResolver::EXTENSIONS

Instance Attribute Summary

Attributes inherited from FileSystemResolver

#path

Instance Method Summary collapse

Methods inherited from FileSystemResolver

#eql?

Methods inherited from PathResolver

#clear_cache

Methods inherited from Resolver

#clear_cache, #find_all, #find_all_with_query

Constructor Details

#initialize(hash = {}) ⇒ FixtureResolver

Returns a new instance of FixtureResolver.



11
12
13
14
15
# File 'lib/action_view/testing/resolvers.rb', line 11

def initialize(hash = {})
  super("")
  @hash = hash
  @path = ""
end

Instance Method Details

#dataObject



17
18
19
# File 'lib/action_view/testing/resolvers.rb', line 17

def data
  @hash
end

#to_sObject



21
22
23
# File 'lib/action_view/testing/resolvers.rb', line 21

def to_s
  @hash.keys.join(", ")
end