rspec-file_fixtures

0.1.9
Light Mode Dark Mode

Usage

RSpec::FileFixtures provides a helper named fixture available in all specs. This method receives a filename as a string and the provided file is loaded from spec/fixtures/.

Fetch the fixture’s path:

subject { fixture('example.yaml').path }

it { is_expected.to end_with '/spec/fixtures/example.yaml' }
"/home/bob/dev/rspec-file_fixtures/spec/fixtures/example.yaml"

Read the fixture’s content:

subject { fixture('example.yaml').read }

it { is_expected.to include 'key: value' }
---
key: value

A number of extensions are provided to assist dealing with common data types. See each item in the Usage section for details.


Documentation generated by rspec-documentation