Module: ElabsMatchers::Helpers::Fixtures
- Defined in:
- lib/elabs_matchers/helpers/fixtures.rb
Instance Method Summary collapse
-
#fixture_file(path) ⇒ Object
Opens a file from the fixtures directory.
Instance Method Details
#fixture_file(path) ⇒ Object
Opens a file from the fixtures directory.
Example: fixture_file(“file.txt”)
15 16 17 18 |
# File 'lib/elabs_matchers/helpers/fixtures.rb', line 15 def fixture_file(path) root = if defined?(Rails) then Rails.root else "../../../spec/" end File.open(File.("#{root}/fixtures/#{path}", File.dirname(__FILE__))) end |