Module: Crspec::FileFixtures

Defined in:
lib/crspec/file_fixtures.rb

Instance Method Summary collapse

Instance Method Details

#file_fixture(fixture_name) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
14
15
16
# File 'lib/crspec/file_fixtures.rb', line 11

def file_fixture(fixture_name)
  path = Pathname.new(File.join(file_fixture_path, fixture_name))
  return path if path.file?

  raise ArgumentError, "the directory '#{file_fixture_path}' does not contain a file named '#{fixture_name}'"
end

#file_fixture_pathObject



7
8
9
# File 'lib/crspec/file_fixtures.rb', line 7

def file_fixture_path
  Crspec.configuration.file_fixture_path
end