Module: ErgomentumRspec::Helpers::Fixture

Defined in:
lib/ergomentum_rspec/helpers/fixture.rb

Instance Method Summary collapse

Instance Method Details

#fixture(relative_path) ⇒ Object



10
11
12
# File 'lib/ergomentum_rspec/helpers/fixture.rb', line 10

def fixture(relative_path)
  fixtures_directory / relative_path
end

#fixtures_directoryObject



14
15
16
# File 'lib/ergomentum_rspec/helpers/fixture.rb', line 14

def fixtures_directory
  spec_directory / "fixtures"
end

#load_fixture(relative_path) ⇒ Object



6
7
8
# File 'lib/ergomentum_rspec/helpers/fixture.rb', line 6

def load_fixture(relative_path)
  File.read(fixture(relative_path))
end

#spec_directoryObject



18
19
20
# File 'lib/ergomentum_rspec/helpers/fixture.rb', line 18

def spec_directory
  Pathname.getwd / "spec"
end