Skip to content

Instantly share code, notes, and snippets.

@amatsuda
Created October 1, 2009 03:50
Show Gist options
  • Save amatsuda/198708 to your computer and use it in GitHub Desktop.
Save amatsuda/198708 to your computer and use it in GitHub Desktop.
def use_factory(name)
require 'factory_girl'
defined_factories = Factory.factories.try(:map) {|f| f.first}
require "spec/factories/#{name}"
loaded_factories = Factory.factories.try(:map) {|f| f.first} - defined_factories
puts "loaded: #{loaded_factories.join(', ')}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment