Class: Perfume::Testing::FixtureFiles

Inherits:
Object
  • Object
show all
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

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