Class: ActionView::FixtureResolver

Inherits:
PathResolver 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 collapse

Instance Method Summary collapse

Methods inherited from Resolver

#clear_cache, #find_all, #find_all_anywhere, #find_all_with_query

Constructor Details

#initialize(hash = {}, pattern = nil) ⇒ FixtureResolver

Returns a new instance of FixtureResolver.



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

def initialize(hash = {}, pattern = nil)
  super(pattern)
  @hash = hash
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



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

def hash
  @hash
end

Instance Method Details

#to_sObject



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

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