mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
180eb8bec7
This introduces a couple of things: firstly, there's now a MockFactory that allows for introspection instead of spying all over the place. This should make tests a lot less brittle. Secondly, a couple of handy matchers have been made available to perform assertions against the mock.
25 lines
536 B
Ruby
25 lines
536 B
Ruby
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
|
|
$LOAD_PATH << File.join(File.dirname(__FILE__))
|
|
|
|
require 'rubygems'
|
|
require 'rspec'
|
|
require 'rspec/autorun'
|
|
|
|
require 'factory_girl'
|
|
require "mocha"
|
|
require "bourne"
|
|
require "timecop"
|
|
|
|
Dir["spec/support/**/*.rb"].each { |f| require File.expand_path(f) }
|
|
|
|
RSpec.configure do |config|
|
|
config.mock_framework = :mocha
|
|
|
|
config.include DeclarationMatchers
|
|
|
|
config.after do
|
|
FactoryGirl.factories.clear
|
|
FactoryGirl.sequences.clear
|
|
FactoryGirl.traits.clear
|
|
end
|
|
end
|