rspec-file_fixtures

0.1.9
Light Mode Dark Mode

Introduction

RSpec::FileFixtures provides convenient and consistent access to fixture data in RSpec.

Installation

Add the following to your Gemfile in your :test group:

gem 'rspec-file_fixtures', '~> 0.1.6'

Setup

Enable the RSpec extension is your spec helper:

# spec/spec_helper.rb

require 'rspec/file_fixtures'

Usage

Use the provided fixture helper anywhere in your tests to load content from spec/fixtures/:

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

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

See the Usage section for available extensions.


Documentation generated by rspec-documentation