Supporting minitest #68

wants to merge 8 commits into

7 participants


Added minitest support. Otherwise it's not possible to use mini test with factory girl fixtures. Maybe this gem should not touch the test framwork setups at all?


Thank you! Just got crazy over this problem. Using your fork for now :)


Here is my fix: jonesdeini@fe632cf
It's very general and works with test_unit or mini_test.


+1 for @jonesdeini's fix.

Umur Ozkul Minitest and all frameworks supported. Because you configure them nor…
…mally. They are not touched here. +1 for @joedesini

I've merged @jonesdeini's fix.
MiniTesting with FactoryGirl now. Just having normal configuration in my application.rb

DemoBlogHobo::Application.configure do
  config.generators do |g|
    g.test_framework :mini_test, :spec => true, :fixture=>false, :fixture_replacement=>:factory_girl

You don't need to add this to your configuration to your config/application.rb file because the factory_girl_rails gem in your Gemfile will do this for you, right?

thoughtbot, inc. member

This breaks features/fixture_replacement_config.feature:18 because it no longer generates the factory file correctly.

thoughtbot, inc. member

The reason I know the test is failing is because I tried to merge this, because we want this feature.

It's worth noting that this branch did not merge cleanly. Perhaps if you rebase against master you will do a better job resolving conflicts than I.

This is the failure I see. I do not see it in master, only in this branch:

~/thoughtbot/factory_girl_rails% ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]
~/thoughtbot/factory_girl_rails% rake
/home/mike/.rvm/rubies/ruby-1.9.2-p320/bin/ruby -S bundle exec cucumber --format progress

(::) failed steps (::)

expected file?("test/factories/users.rb") to return true, got false (RSpec::Expectations::ExpectationNotMetError)
features/fixture_replacement_config.feature:18:in `Then the following files should exist:'

Failing Scenarios:
cucumber features/fixture_replacement_config.feature:14 # Scenario: Using Factory Girl and Factory Girl Rails with Test Unit generates
a factory file and does not generate a fixture file

5 scenarios (1 failed, 4 passed)
49 steps (1 failed, 1 skipped, 47 passed)
rake aborted!
Command failed with status (1): [/home/mike/.rvm/rubies/ruby-1.9.2-p320/bin...]

Tasks: TOP => default => cucumber
(See full trace by running task with --trace)
@joshuaclayton joshuaclayton added a commit that closed this pull request Dec 10, 2012
@joshuaclayton joshuaclayton Initial support for MiniTest
Closes #68, #75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment