paulelliott/fabrication — pull request #221 by paul (2014-09-06 01:21:48+00:00)
Title: Cobble together a failing-ish scenario with fixtures

Alright, I added an AR fabricator that attempts to use a fixture, and hacked enough rspec+rails into the spec_helper so that the next failure is in fabricator code:

```
$ appraisal rails-4.1 rspec spec/integration_spec.rb -e active_record
...
29) Fabrication active_record models with fixtures should load the parent from fixtures
Failure/Error: subject(:child) { Fabricate(:child_active_record_model_with_parent_fixture) }
TypeError:
no implicit conversion of nil into String
# ./lib/fabrication/schematic/manager.rb:46:in `join'
# ./lib/fabrication/schematic/manager.rb:46:in `block (2 levels) in load_definitions'
# ./lib/fabrication/schematic/manager.rb:45:in `each'
# ./lib/fabrication/schematic/manager.rb:45:in `block in load_definitions'
# ./lib/fabrication/schematic/manager.rb:44:in `each'
# ./lib/fabrication/schematic/manager.rb:44:in `load_definitions'
# ./lib/fabricate.rb:37:in `schematic'
# ./lib/fabricate.rb:29:in `create'
# ./lib/fabrication.rb:62:in `Fabricate'
# ./spec/integration_spec.rb:129:in `block (4 levels) in '
```

This error, however, is different than the one I get when attempting to do this in a proper rails app, so I'm not sure if something else needs set up. This whole thing is kinda a mess though, I'm wondering if its better to just generate a demo rails app exhibiting the problem in another repo, or maybe just into the `spec/support` directory as other rails-dependent gems (like engines) tend to do. Fabricator isn't dependent on rails, though, so that might be a bit much.