0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
FixtureGroup is an extension of the ActiveRecord Fixtures that make possible to create fixtures group
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 10.0
>= 1.3

Runtime

 Project Readme

Fixture Group

Gem Version Build Status Code Climate

An extension of the ActiveRecord Fixtures that make possible to create fixtures group.

Features

Rails.root/
 `- test/
     `- fixtures/
         |- case_a/
         |   |- users.yml
         |   `- items.yml
         `- case_b/
             |- subcase_b1/
             |   |- users.yml
             |   `- items.yml
             `- subcase_b2/
                 |- users.yml
                 `- items.yml
class FooControllerTest < ActiveSupport::TestCase
  fixture_group 'case_a', :all
end

class BarScenarioTest < ActionDispatch::IntegrationTest
  fixture_group 'case_b/subcase_b2', :all
end

class UserTest < ActiveSupport::TestCase
  fixture_group 'case_b', :users
end

Supported versions

  • Ruby 2.3 + ActiveRecord 4.2, 5.0
  • Ruby 2.4 + ActiveRecord 5.0

Install

Put this line in your Gemfile:

gem 'fixture_group', group: :test

Then bundle:

% bundle

Usage

Please see *_test.rb in test/integration.

DON'T DO THIS

class FooTest < ActiveSupport::TestCase
  fixture_group 'case_a', :users
  fixture_group 'case_b', :users
end

In this code, case_b/users.yml will be loaded, but case_a/users.yml will be ignored.

Questions, Feedback

Gitter

or, feel free to message me on GitHub or Twitter (@hidakatsuya)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

© Katsuya HIDAKA. See MIT-LICENSE for further details.