rspec-file_fixtures

0.1.9
Light Mode Dark Mode

Pathname

The object returned from each call to fixture delegates to its underlying Pathname object, so you can call #path, #read, #dirname etc. just like a regular Ruby Pathname object.

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

it { is_expected.to include '<a type="integer">1</a>' }
<?xml version="1.0" encoding="UTF-8"?>
<thing>
  <a type="integer">1</a>
</thing>
subject { fixture('example.json').dirname.to_s }

it { is_expected.to eql 'spec/fixtures' }
"spec/fixtures"
subject { fixture('example.json').relative? }

it { is_expected.to be true }
true

Documentation generated by rspec-documentation