Class: Perfume::Testing::FixtureFiles
- Inherits:
-
Object
- Object
- Perfume::Testing::FixtureFiles
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/perfume/testing/fixture_files.rb
Overview
Public: Sometimes you have to test file contents or some biggest chunks of data. Put them in fixtures folder and load using this helper class. Example:
MY_FIXTURE_FILES = FixtureFiles.load('path/to/fixtures/*.txt')
MY_FIXTURE_FILES.each { |content| ... }
puts MY_FIXTURE_FILES['filename.txt']
Instance Method Summary collapse
-
#initialize(dir) ⇒ FixtureFiles
constructor
A new instance of FixtureFiles.
Constructor Details
#initialize(dir) ⇒ FixtureFiles
Returns a new instance of FixtureFiles.
23 24 25 |
# File 'lib/perfume/testing/fixture_files.rb', line 23 def initialize(dir) @fixtures = load_fixtures(dir) end |