rspec/rspec-rails — Issue #510: set_fixture_class doesn't work in config.before block
Author: skizzybiz
Created: 2012-02-28 22:13:56+00:00
State: open

This does not work:

RSpec.configure do |config|
config.before { set_fixture_class :foo => Bar }
end

If I try to run that, it tells me: `spec_helper.rb:6:in 'included': undefined method 'set_fixture_class' for FixtureClasses:Module (NoMethodError)`.

In order to get the equivalent functionality, I need to jump through hoops like:

module FixtureClasses
extend ActiveSupport::Concern
included do
set_fixture_class :foo => Bar
end
end

RSpec.configure do |config|
config.include FixtureClasses
end