0.0
No commit activity in last 3 years
No release in over 3 years
FixtureParts registers data in DB for each test.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.2
 Project Readme

FixtureParts

FixtureParts registers data in DB for each test.

Usage

How to use.

class HogeTest < ActiveSupport::TestCase
  # File specification
  test "hoge_count" do
    FixtureParts.load("test/fixture_parts/hoge_test/hoges.yml")
    assert_equal(1, Hoge.all.count)
  end

  # Directory specification
  test "hoge_fuga_count" do
    FixtureParts.load_dir("test/fixture_parts/hoge_test")
    assert_equal(1, Hoge.all.count)
    assert_equal(1, Fuga.all.count)
  end

  # no validation
  test "load_no_validation" do
    FixtureParts.load("test/fixture_parts/hoge_test/hoges.yml", valid: false)
  end
end

#{Rails.root}/test/fixture_parts/hoge_test/hoges.yml

one:
  id: 1
  integer: 1
  string: one
  boolean: true
  date: 2019-04-12

Installation

Add this line to your application's Gemfile:

gem 'fixture_parts'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fixture_parts

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.