rspec-file_fixtures 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '093408a94e9e51ba94c4f4635a34074e49e4d1b7b10190a13507e57a3bf60141'
4
- data.tar.gz: d53f862a7af51f91c39d60e540b40165e834f97404a6884a8c969d6b362c33e3
3
+ metadata.gz: 18c47f70c0d769c839cc22ada66950e6dd6da2c17bf889c20c437f6b0fc0a9ca
4
+ data.tar.gz: 0b72c0874186f10e6056c01f28f11926f89e4845e2a7699b9ac9531d6d4cba8f
5
5
  SHA512:
6
- metadata.gz: c888bf111292b125e6e8adeac538a0da5e94f861de1033e1154376210135cea3bf1622ef192bbecfa2d6a9de91c9b4e458edb6f998e91c6e9c8cc936431685e4
7
- data.tar.gz: b3002dc69032e39af2e889ff7bfc8ea857dc66e355375150b98ca7ec35ef48c093df2a5d7af9c1d31cf118b5b20b597a24c9b38bfe9903c8e3bcfa11a050fd9b
6
+ metadata.gz: 1d98eaa662f6bad79124257c63a45f5383244005943d76445da80dbf5a94099999d301a580866f94afecf124d5edc7e487aafa8abebde7f2bfe3a92dd629e1ab
7
+ data.tar.gz: 74ef86e76c093e70eea4df1326eecb191f8d216f1f97bef970c1668caafdfa9705bb758ad211ac8bd3751129c586f2a19482bf29345c0db625487f61c68321a9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-file_fixtures (0.1.9)
4
+ rspec-file_fixtures (0.1.10)
5
5
  rspec (~> 3.12)
6
6
 
7
7
  GEM
@@ -111,4 +111,4 @@ DEPENDENCIES
111
111
  strong_versions (~> 0.4.5)
112
112
 
113
113
  BUNDLED WITH
114
- 2.4.14
114
+ 2.4.22
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  A simple and convenient file fixture loader for [_RSpec_](https://rspec.info/).
4
4
 
5
5
  ```ruby
6
- let(:my_fixture) { fixture('my_fixture.json').read }
6
+ let(:my_fixture) { load_fixture('my_fixture.json').read }
7
7
  ```
8
8
 
9
9
  ## Documentation
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RSpecFileFixtures
4
- VERSION = '0.1.9'
4
+ VERSION = '0.1.10'
5
5
  end
@@ -15,6 +15,7 @@ module RSpecFileFixtures
15
15
  def fixture(path)
16
16
  Fixture.new(path)
17
17
  end
18
+ alias load_fixture fixture
18
19
  end
19
20
 
20
21
  RSpec.configure do |config|
@@ -25,7 +25,7 @@ require 'rspec/file_fixtures'
25
25
  Use the provided `fixture` helper anywhere in your tests to load content from `spec/fixtures/`:
26
26
 
27
27
  ```rspec:json
28
- subject { fixture('example.json').read }
28
+ subject { load_fixture('example.json').read }
29
29
 
30
30
  it { is_expected.to include '{"key":"value"}' }
31
31
  ```
@@ -5,7 +5,7 @@ _JSON_ fixtures can be parsed into a _Ruby_ object using the `#from_json` method
5
5
  This is equivalent to `JSON.parse(..., symbolize_names: true)`.
6
6
 
7
7
  ```rspec
8
- subject { fixture('example.json').from_json }
8
+ subject { load_fixture('example.json').from_json }
9
9
 
10
10
  it { is_expected.to eql({ key: 'value' }) }
11
11
  ```
@@ -15,7 +15,7 @@ it { is_expected.to eql({ key: 'value' }) }
15
15
  Keys are symbolized by default. If you prefer to work with strings, pass `symbolize_names: false`:
16
16
 
17
17
  ```rspec
18
- subject { fixture('example.json').from_json(symbolize_names: false) }
18
+ subject { load_fixture('example.json').from_json(symbolize_names: false) }
19
19
 
20
20
  it { is_expected.to eql({ 'key' => 'value' }) }
21
21
  ```
@@ -5,7 +5,7 @@ _YAML_ fixtures can be parsed into a _Ruby_ object using the `#from_yaml` method
5
5
  This is equivalent to `YAML.safe_load(..., symbolize_names: true)`.
6
6
 
7
7
  ```rspec
8
- subject { fixture('example.yaml').from_yaml }
8
+ subject { load_fixture('example.yaml').from_yaml }
9
9
 
10
10
  it { is_expected.to eql({ key: 'value' }) }
11
11
  ```
@@ -15,7 +15,7 @@ it { is_expected.to eql({ key: 'value' }) }
15
15
  Keys are symbolized by default. If you prefer to work with strings, pass `symbolize_names: false`:
16
16
 
17
17
  ```rspec
18
- subject { fixture('example.yaml').from_yaml(symbolize_names: false) }
18
+ subject { load_fixture('example.yaml').from_yaml(symbolize_names: false) }
19
19
 
20
20
  it { is_expected.to eql({ 'key' => 'value' }) }
21
21
  ```
@@ -5,7 +5,7 @@ _XML_ fixtures can be parsed into a _Ruby_ [Nokogiri::XML::Document](https://nok
5
5
  _Nokogiri_ is not a hard dependency of _Rspec::FileFixtures_ so you must install and require _Nokogiri_ yourself to use this feature.
6
6
 
7
7
  ```rspec
8
- subject { fixture('example.xml').from_xml }
8
+ subject { load_fixture('example.xml').from_xml }
9
9
 
10
10
  it { is_expected.to be_a Nokogiri::XML::Document }
11
11
  ```
@@ -5,7 +5,7 @@ You can use the `#copy_to(destination)` method to copy the fixture file to the d
5
5
  ```rspec:json
6
6
  subject { File.read(destination_path).chomp }
7
7
 
8
- let(:example_fixture) { fixture('example.json') }
8
+ let(:example_fixture) { load_fixture('example.json') }
9
9
  let(:destination_path) { File.join(Dir.mktmpdir, 'path/to/destination/copied.json') }
10
10
 
11
11
  before { example_fixture.copy_to(destination_path) }
@@ -3,19 +3,19 @@
3
3
  The object returned from each call to `fixture` delegates to its underlying [`Pathname`](https://docs.ruby-lang.org/en/3.2/Pathname.html) object, so you can call `#path`, `#read`, `#dirname` etc. just like a regular _Ruby_ `Pathname` object.
4
4
 
5
5
  ```rspec:xml
6
- subject { fixture('example.xml').read }
6
+ subject { load_fixture('example.xml').read }
7
7
 
8
8
  it { is_expected.to include '<a type="integer">1</a>' }
9
9
  ```
10
10
 
11
11
  ```rspec
12
- subject { fixture('example.json').dirname.to_s }
12
+ subject { load_fixture('example.json').dirname.to_s }
13
13
 
14
14
  it { is_expected.to eql 'spec/fixtures' }
15
15
  ```
16
16
 
17
17
  ```rspec
18
- subject { fixture('example.json').relative? }
18
+ subject { load_fixture('example.json').relative? }
19
19
 
20
20
  it { is_expected.to be true }
21
21
  ```
@@ -5,7 +5,7 @@ Create a `Rack::Test::UploadedFile` instance by calling `#upload(content_type: '
5
5
  The returned object can be passed as a parameter in a _request_ spec to simulate uploading a file.
6
6
 
7
7
  ```rspec
8
- subject { fixture('example.xml').upload(content_type: 'application/xml') }
8
+ subject { load_fixture('example.xml').upload(content_type: 'application/xml') }
9
9
 
10
10
  it { is_expected.to be_a Rack::Test::UploadedFile }
11
11
  ```
@@ -1,11 +1,11 @@
1
1
  # Usage
2
2
 
3
- _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/`.
3
+ _RSpec::FileFixtures_ provides a helper named `file_fixture` available in all specs. This method receives a filename as a string and the provided file is loaded from `spec/fixtures/`.
4
4
 
5
5
  Fetch the fixture's path:
6
6
 
7
7
  ```rspec
8
- subject { fixture('example.yaml').path }
8
+ subject { load_fixture('example.yaml').path }
9
9
 
10
10
  it { is_expected.to end_with '/spec/fixtures/example.yaml' }
11
11
  ```
@@ -13,7 +13,7 @@ it { is_expected.to end_with '/spec/fixtures/example.yaml' }
13
13
  Read the fixture's content:
14
14
 
15
15
  ```rspec:yaml
16
- subject { fixture('example.yaml').read }
16
+ subject { load_fixture('example.yaml').read }
17
17
 
18
18
  it { is_expected.to include 'key: value' }
19
19
  ```
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-file_fixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-02 00:00:00.000000000 Z
11
+ date: 2025-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec