Skip to content

Releases: nepalez/fixturama

Bug fixes

12 Apr 15:30
Compare
Choose a tag to compare
v0.5.1

Bump v0.5.1

Support PORO object <de>serialization

03 Apr 18:44
Compare
Choose a tag to compare

Use object() method to serialize/deserialize PORO objects in a fixture:

# target.yml
---
number: <%= object(be_positive) %>
RSpec.describe "example" do
  subject { { number: 42 } }

  # no explicit parameters are needed to send `be_positive`
  let(:target) { load_fixture "target.yml" }

  it { is_expected.to match(target) }
end

In versions v0.4.1 and below, the same feature required sending data explicitly:

---
number: <%= positive %>
RSpec.describe "example" do
  # ...
  let(:target) { load_fixture "target.yml", positive: be_positive }
  # ...
end

Update dependency from hashie

31 Mar 18:02
Compare
Choose a tag to compare
v0.4.1

Bump v0.4.1

Support stubbing of environment variables

15 Mar 20:02
Compare
Choose a tag to compare
---
- env: DEFAULT_EMAIL
  value: foo@example.com

Support arguments of exceptions to be risen

08 Mar 20:46
Compare
Choose a tag to compare
---
- class: API
  chain: get_product
  arguments:
    - 1
  actions:
    - raise: API::NotFoundError
      arguments:
        - "Cannot find product by id: 1"

This would raise the following exception instance:

API::NotFoundError.new("Cannot find product by id: 1")

Support single-source changes with `call_fixture`

17 Feb 10:24
Compare
Choose a tag to compare
# ./changes.yml
---
- type: user
  params:
    id: 1

- const: DEFAULT_USER_ID
  value: 1

- url: https://example.com/users/default
  method: get
  responses:
    - body:
        id: 1
        name: Andrew
before { call_fixture "#{__dir__}/changes.yml" }

Support stubbing of http requests

09 Feb 19:55
Compare
Choose a tag to compare
---
- url: https://example.com/foo
  method: delete
  headers:
    Content-Language: en_US
  basic_auth:
    user: foo
    password: bar
  responses:
    - status: 200 # for the first call
    - status: 404 # for the other calls

Support stubbing of arbitrary objects

01 Jul 09:10
Compare
Choose a tag to compare
---
- object: Rails.application
  chain: env
  actions:
    - return: production

In addition, this release adds support for partially defined key arguments during object/class stubbing.
See details at the CHANGELOG

Support serialization of arbitrary ruby objects

09 Jun 16:05
Compare
Choose a tag to compare
---
:account: <%= user %>
let(:user) { FactoryBot.create :user }
subject    { load_fixture "#{__dir__}/output.yml", user: user }

# The `user` object has been bound via ERB
it { is_expected.to eq account: user }

Support stubbing of constants

04 Jun 12:27
Compare
Choose a tag to compare

Use the following syntax in "stubbing" fixtures:

---
- const: TIMEOUT
  value: 10