factory_girl_rails-4.4.1/0000755000004100000410000000000012310315200015411 5ustar www-datawww-datafactory_girl_rails-4.4.1/Rakefile0000644000004100000410000000074112310315200017060 0ustar www-datawww-datarequire 'bundler/setup' require 'bundler/gem_tasks' require 'cucumber/rake/task' Cucumber::Rake::Task.new(:cucumber) do |t| t.fork = true t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')] end require 'appraisal' desc 'Run the test suite' task :default do |t| if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/ exec 'rake cucumber' else Rake::Task['appraise'].execute end end task :appraise => ['appraisal:install'] do |t| exec 'rake appraisal' end factory_girl_rails-4.4.1/factory_girl_rails.gemspec0000644000004100000410000000216412310315200022637 0ustar www-datawww-dataGem::Specification.new do |s| s.name = %q{factory_girl_rails} s.version = '4.4.1' s.authors = ["Joe Ferris"] s.email = %q{jferris@thoughtbot.com} s.homepage = "http://github.com/thoughtbot/factory_girl_rails" s.summary = %q{factory_girl_rails provides integration between factory_girl and rails 3} s.description = %q{factory_girl_rails provides integration between factory_girl and rails 3 (currently just automatic factory definition loading)} s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- Appraisals {spec,features,gemfiles}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.license = "MIT" s.add_runtime_dependency('railties', '>= 3.0.0') s.add_runtime_dependency('factory_girl', '~> 4.4.0') s.add_development_dependency('appraisal', '~> 0.5.0') s.add_development_dependency('rake') s.add_development_dependency('rspec', '~> 2.11.0') s.add_development_dependency('cucumber', '~> 1.2.1') s.add_development_dependency('aruba', '~> 0.5.1') end factory_girl_rails-4.4.1/Gemfile0000644000004100000410000000004712310315200016705 0ustar www-datawww-datasource "https://rubygems.org" gemspec factory_girl_rails-4.4.1/features/0000755000004100000410000000000012310315200017227 5ustar www-datawww-datafactory_girl_rails-4.4.1/features/step_definitions/0000755000004100000410000000000012310315200022575 5ustar www-datawww-datafactory_girl_rails-4.4.1/features/step_definitions/rails_steps.rb0000644000004100000410000000331112310315200025450 0ustar www-datawww-dataWhen /^I add "([^"]+)" from this project as a dependency$/ do |gem_name| append_to_file('Gemfile', %{gem "#{gem_name}", :path => "#{PROJECT_ROOT}"\n}) end When /^I add "([^"]+)" as a dependency$/ do |gem_name| append_to_file('Gemfile', %{gem "#{gem_name}"\n}) end When /^I set the FactoryGirl :suffix option to "([^"]+)"$/ do |suffix| append_to_file('config/application.rb', <<-RUBY) module Testapp class Application < Rails::Application config.generators do |g| g.fixture_replacement :factory_girl, :suffix => '#{suffix}' end end end RUBY end When /^I configure the factories as:$/ do |string| append_to_file File.join('config', 'application.rb'), <<-END class Testapp::Application #{string} end END end When /^I configure the factories directory as "([^"]+)"$/ do |factory_dir| append_to_file File.join('config', 'application.rb'), <<-END class Testapp::Application config.generators do |g| g.fixture_replacement :factory_girl, :dir => "#{factory_dir}" end end END end When /^I configure the testing framework to use MiniTest$/ do append_to_file('Gemfile', %{gem "minitest-rails", :group => [:development, :test]\n}) step %{I run `rails generate mini_test:install` with a clean environment} append_to_file File.join('config', 'application.rb'), <<-END class Testapp::Application config.generators do |g| g.test_framework :mini_test, :fixture => false, :fixture_replacement => :factory_girl end end END end When /^I comment out gem "([^"]*)" from my Gemfile$/ do |gem_name| in_current_dir do content = File.read('Gemfile') File.open('Gemfile', 'w') do |f| f.write content.sub(/gem ['"]#{gem_name}/, '#\1') end end end factory_girl_rails-4.4.1/features/step_definitions/appraisal.rb0000644000004100000410000000035712310315200025103 0ustar www-datawww-dataWhen /^I run `([^"]+)` with a clean environment$/ do |command| step %{I successfully run `ruby -e 'system({"BUNDLE_GEMFILE" => nil}, "#{command}")'`} end # system({'BUNDLE_GEMFILE' => nil}, "cd tmp/aruba/testapp && #{command} && cd -") factory_girl_rails-4.4.1/features/fixture_replacement_config.feature0000644000004100000410000001052512310315200026201 0ustar www-datawww-dataFeature: In order to not have to manually configure factory girl as the testing fixture replacement by using the --fixture-replacement=factory_girl option as a Rails3 and Factory Girl user I would like the Factory Girl Rails gem to configure Factory Girl as the fixture replacement. Background: Given I successfully run `bundle exec rails new testapp` And I cd to "testapp" And I add "factory_girl_rails" from this project as a dependency Scenario: Using Factory Girl and Factory Girl Rails with Test Unit generates a factory file and does not generate a fixture file And I run `bundle install` with a clean environment And I run `bundle exec rails generate model User name:string` with a clean environment Then the following files should exist: | test/factories/users.rb | And the following files should not exist: | test/fixtures/users.yml | Scenario: Using Factory Girl and Factory Girl Rails with RSpec should generate a factory file When I add "rspec-rails" as a dependency And I configure the factories as: """ config.generators do |g| g.test_framework :rspec, fixture: true g.fixture_replacement :factory_girl end """ And I run `bundle install` with a clean environment Then the output should contain "rspec-rails" And I run `bundle exec rails generate model User name:string` with a clean environment Then the following files should exist: | spec/factories/users.rb | And the following files should not exist: | spec/fixtures/users.yml | Scenario: Using Factory Girl and Factory Girl Rails does not override a manually-configured factories directory using RSpec When I add "rspec-rails" as a dependency And I configure the factories directory as "custom/dir" And I run `bundle install` with a clean environment Then the output should contain "rspec-rails" And I run `bundle exec rails generate model User name:string` with a clean environment Then the following files should not exist: | test/factories/users.rb | | spec/factories/users.rb | But the following files should exist: | custom/dir/users.rb | Scenario: Using Factory Girl and Factory Girl Rails does not override a manually-configured factories directory using Test::Unit When I configure the factories directory as "custom/dir" And I run `bundle install` with a clean environment And I run `bundle exec rails generate model User name:string` with a clean environment Then the following files should not exist: | test/factories/users.rb | | spec/factories/users.rb | But the following files should exist: | custom/dir/users.rb | Scenario: Using Factory Girl and Factory Girl Rails with MiniTest should generate a factory file When I add "minitest" as a dependency And I configure the testing framework to use MiniTest And I run `bundle install` with a clean environment Then the output should contain "minitest" And I run `bundle exec rails generate model User name:string` with a clean environment Then the following files should exist: | test/factories/users.rb | But the following files should not exist: | spec/fixtures/users.yml | Scenario: Using Factory Girl and Factory Girl Rails with MiniTest and a custom directory should generate a factory file When I configure the factories directory as "custom/dir" And I add "minitest" as a dependency And I configure the testing framework to use MiniTest And I run `bundle install` with a clean environment Then the output should contain "minitest" And I run `bundle exec rails generate model User name:string` with a clean environment Then the following files should exist: | custom/dir/users.rb | But the following files should not exist: | spec/fixtures/users.yml | And the file "test/models/user_test.rb" should contain "MiniTest::Rails::ActiveSupport::TestCase" Scenario: Disable Factory Girl generator When I configure the factories as: """ config.generators do |g| g.factory_girl false end """ And I run `bundle install` with a clean environment And I run `bundle exec rails generate model User name:string` with a clean environment Then the following files should not exist: | test/factories/users.rb | | spec/factories/users.rb | factory_girl_rails-4.4.1/features/generators.feature0000644000004100000410000000370712310315200022764 0ustar www-datawww-dataFeature: In order to easily generate factory files instead of fixture files when generating models As a user of Rails3 and factory_girl I would like to use factory_girl_rails generators. Background: Given I successfully run `bundle exec rails new testapp` And I cd to "testapp" And I add "factory_girl_rails" from this project as a dependency Scenario: The factory_girl_rails generators create a factory file for each model that I generate When I run `bundle install` with a clean environment And I run `bundle exec rails generate model User name:string --fixture-replacement=factory_girl` with a clean environment And I run `bundle exec rails generate model Namespaced::User name:string --fixture-replacement=factory_girl` with a clean environment Then the output should contain "test/factories/users.rb" And the output should contain "test/factories/namespaced_users.rb" And the file "test/factories/users.rb" should contain "factory :user do" And the file "test/factories/namespaced_users.rb" should contain "factory :namespaced_user, :class => 'Namespaced::User' do" Scenario: The factory_girl_rails generators create a factory file with a custom name for each model that I generate When I run `bundle install` with a clean environment And I set the FactoryGirl :suffix option to "factory" And I run `bundle exec rails generate model User name:string --fixture-replacement=factory_girl` with a clean environment And I run `bundle exec rails generate model Namespaced::User name:string --fixture-replacement=factory_girl` with a clean environment Then the output should contain "test/factories/users_factory.rb" And the output should contain "test/factories/namespaced_users_factory.rb" And the file "test/factories/users_factory.rb" should contain "factory :user do" And the file "test/factories/namespaced_users_factory.rb" should contain "factory :namespaced_user, :class => 'Namespaced::User' do" factory_girl_rails-4.4.1/features/load_definitions.feature0000644000004100000410000000522612310315200024123 0ustar www-datawww-dataFeature: automatically load step definitions Background: When I successfully run `bundle exec rails new testapp` And I cd to "testapp" And I add "factory_girl_rails" from this project as a dependency And I comment out gem "turn" from my Gemfile And I run `bundle install` with a clean environment And I write to "db/migrate/1_create_users.rb" with: """ class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name end end end """ When I run `bundle exec rake db:migrate --trace` with a clean environment And I write to "app/models/user.rb" with: """ class User < ActiveRecord::Base end """ Scenario: generate a rails 3 application and use factory definitions When I write to "test/factories.rb" with: """ FactoryGirl.define do factory :user do name "Frank" end end """ When I write to "test/unit/user_test.rb" with: """ require 'test_helper' class UserTest < ActiveSupport::TestCase test "use factory" do user = FactoryGirl.create(:user) assert_equal 'Frank', user.name end end """ When I run `bundle exec rake test --trace` with a clean environment Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors" Scenario: use factories advertised by railties/engines/3rd-party gems When I append to "config/application.rb" with: """ require File.expand_path('../../lib/some_railtie/railties.rb', __FILE__) """ When I write to "lib/some_railtie/railties.rb" with: """ module SomeRailtie class Railtie < ::Rails::Engine initializer "some_railtie.factories", :after => "factory_girl.set_factory_paths" do FactoryGirl.definition_file_paths << File.expand_path('../factories', __FILE__) end end end """ When I write to "lib/some_railtie/factories.rb" with: """ FactoryGirl.define do factory :factory_from_some_railtie, :class => 'User' do name 'Artem' end end """ When I write to "test/unit/user_test.rb" with: """ require 'test_helper' class UserTest < ActiveSupport::TestCase test "use factory of some_railtie" do user = FactoryGirl.create(:factory_from_some_railtie) assert_equal 'Artem', user.name end end """ When I run `bundle exec rake test --trace` with a clean environment Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors" factory_girl_rails-4.4.1/features/support/0000755000004100000410000000000012310315200020743 5ustar www-datawww-datafactory_girl_rails-4.4.1/features/support/env.rb0000644000004100000410000000115612310315200022063 0ustar www-datawww-datarequire 'aruba/cucumber' PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze Before do @aruba_timeout_seconds = 3600 end Aruba.configure do |config| config.before_cmd do |cmd| set_env('JRUBY_OPTS', "-X-C #{ENV['JRUBY_OPTS']}") # disable JIT since these processes are so short lived java_options = ENV['JAVA_OPTS'] if 1.size == 4 # 4 for 32 bit java, 8 for 64 bit java. set_env('JAVA_OPTS', "-d32 #{java_options}") else set_env('JAVA_OPTS', "-XX:+TieredCompilation -XX:TieredStopAtLevel=1 #{java_options}") end end end if RUBY_PLATFORM == 'java' factory_girl_rails-4.4.1/NEWS0000644000004100000410000000055712310315200016117 0ustar www-datawww-data4.4.1 (February 26, 2014) Support Spring 4.2.1 (February 8, 2013) Fix bug when configuring FG and RSpec fixture directory Remove debugging Require factory_girl_rails explicitly in generator 4.2.0 (January 25, 2013) Add appraisal and get test suite working reliably with turn gem Support MiniTest Allow a custom directory for factories to be specified factory_girl_rails-4.4.1/.travis.yml0000644000004100000410000000042212310315200017520 0ustar www-datawww-datarvm: - 1.9.3 - 2.0.0 - jruby-19mode before_install: - gem update --system - gem install turn --version 0.8.2 - gem install turn --version 0.8.3 jdk: - openjdk6 gemfile: - gemfiles/rails3.1.gemfile - gemfiles/rails3.2.gemfile branches: only: - master factory_girl_rails-4.4.1/lib/0000755000004100000410000000000012310315200016157 5ustar www-datawww-datafactory_girl_rails-4.4.1/lib/generators/0000755000004100000410000000000012310315200020330 5ustar www-datawww-datafactory_girl_rails-4.4.1/lib/generators/factory_girl/0000755000004100000410000000000012310315200023014 5ustar www-datawww-datafactory_girl_rails-4.4.1/lib/generators/factory_girl/model/0000755000004100000410000000000012310315200024114 5ustar www-datawww-datafactory_girl_rails-4.4.1/lib/generators/factory_girl/model/templates/0000755000004100000410000000000012310315200026112 5ustar www-datawww-datafactory_girl_rails-4.4.1/lib/generators/factory_girl/model/templates/fixtures.erb0000644000004100000410000000042412310315200030455 0ustar www-datawww-data# Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do factory :<%= singular_table_name %><%= explicit_class_option %> do <% for attribute in attributes -%> <%= attribute.name %> <%= attribute.default.inspect %> <% end -%> end end factory_girl_rails-4.4.1/lib/generators/factory_girl/model/model_generator.rb0000644000004100000410000000161212310315200027607 0ustar www-datawww-datarequire 'generators/factory_girl' require 'factory_girl_rails' module FactoryGirl module Generators class ModelGenerator < Base argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" class_option :dir, :type => :string, :default => "test/factories", :desc => "The directory where the factories should go" def create_fixture_file filename = [table_name, filename_suffix].compact.join('_') template 'fixtures.erb', File.join(options[:dir], "#{filename}.rb") end private def filename_suffix factory_girl_options[:suffix] end def generators config = FactoryGirl::Railtie.config config.respond_to?(:app_generators) ? config.app_generators : config.generators end def factory_girl_options generators.options[:factory_girl] || {} end end end end factory_girl_rails-4.4.1/lib/generators/factory_girl.rb0000644000004100000410000000070712310315200023345 0ustar www-datawww-datarequire 'rails/generators/named_base' module FactoryGirl module Generators class Base < Rails::Generators::NamedBase #:nodoc: def self.source_root @_factory_girl_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'factory_girl', generator_name, 'templates')) end def explicit_class_option ", :class => '#{class_name}'" unless class_name == singular_table_name.camelize end end end end factory_girl_rails-4.4.1/lib/factory_girl_rails/0000755000004100000410000000000012310315200022035 5ustar www-datawww-datafactory_girl_rails-4.4.1/lib/factory_girl_rails/generators/0000755000004100000410000000000012310315200024206 5ustar www-datawww-datafactory_girl_rails-4.4.1/lib/factory_girl_rails/generators/null_generator.rb0000644000004100000410000000023212310315200027550 0ustar www-datawww-datamodule FactoryGirlRails module Generators class NullGenerator def initialize(generators) end def run end end end end factory_girl_rails-4.4.1/lib/factory_girl_rails/generators/rspec_generator.rb0000644000004100000410000000104612310315200027716 0ustar www-datawww-datamodule FactoryGirlRails module Generators class RSpecGenerator def initialize(generators) @generators = generators end def run @generators.fixture_replacement fixture_replacement_setting, dir: factory_girl_directory end private def fixture_replacement_setting @generators.options[:rails][:fixture_replacement] || :factory_girl end def factory_girl_directory @generators.options.fetch(:factory_girl, { dir: 'spec/factories' })[:dir] end end end end factory_girl_rails-4.4.1/lib/factory_girl_rails/generators/non_rspec_generator.rb0000644000004100000410000000061512310315200030571 0ustar www-datawww-datamodule FactoryGirlRails module Generators class NonRSpecGenerator def initialize(generators) @generators = generators end def run @generators.test_framework test_framework, fixture: false, fixture_replacement: :factory_girl end private def test_framework @generators.options[:rails][:test_framework] end end end end factory_girl_rails-4.4.1/lib/factory_girl_rails/generator.rb0000644000004100000410000000172312310315200024353 0ustar www-datawww-datarequire 'factory_girl_rails/generators/rspec_generator' require 'factory_girl_rails/generators/non_rspec_generator' require 'factory_girl_rails/generators/null_generator' module FactoryGirlRails class Generator def initialize(config) @generators = if config.respond_to?(:app_generators) config.app_generators else config.generators end end def run generator.new(@generators).run end def generator if factory_girl_disabled? Generators::NullGenerator else if test_framework == :rspec Generators::RSpecGenerator else Generators::NonRSpecGenerator end end end def test_framework rails_options[:test_framework] end def factory_girl_disabled? rails_options[:factory_girl] == false end def rails_options @generators.options[:rails] end end end factory_girl_rails-4.4.1/lib/factory_girl_rails/railtie.rb0000644000004100000410000000122512310315200024013 0ustar www-datawww-datarequire 'factory_girl' require 'factory_girl_rails/generator' require 'rails' module FactoryGirl class Railtie < Rails::Railtie initializer "factory_girl.set_fixture_replacement" do FactoryGirlRails::Generator.new(config).run end initializer "factory_girl.set_factory_paths" do FactoryGirl.definition_file_paths = [ Rails.root.join('factories'), Rails.root.join('test', 'factories'), Rails.root.join('spec', 'factories') ] end config.after_initialize do FactoryGirl.find_definitions if defined?(Spring) Spring.after_fork { FactoryGirl.reload } end end end end factory_girl_rails-4.4.1/lib/factory_girl_rails.rb0000644000004100000410000000010212310315200022353 0ustar www-datawww-datarequire 'factory_girl_rails/railtie' module FactoryGirlRails end factory_girl_rails-4.4.1/gemfiles/0000755000004100000410000000000012310315200017204 5ustar www-datawww-datafactory_girl_rails-4.4.1/gemfiles/rails3.1.gemfile.lock0000644000004100000410000000751712310315200023033 0ustar www-datawww-dataPATH remote: /Users/joshuaclayton/dev/gems/factory_girl_rails specs: factory_girl_rails (4.4.1) factory_girl (~> 4.4.0) railties (>= 3.0.0) GEM remote: https://rubygems.org/ specs: actionmailer (3.1.10) actionpack (= 3.1.10) mail (~> 2.3.3) actionpack (3.1.10) activemodel (= 3.1.10) activesupport (= 3.1.10) builder (~> 3.0.0) erubis (~> 2.7.0) i18n (~> 0.6) rack (~> 1.3.6) rack-cache (~> 1.2) rack-mount (~> 0.8.2) rack-test (~> 0.6.1) sprockets (~> 2.0.4) activemodel (3.1.10) activesupport (= 3.1.10) builder (~> 3.0.0) i18n (~> 0.6) activerecord (3.1.10) activemodel (= 3.1.10) activesupport (= 3.1.10) arel (~> 2.2.3) tzinfo (~> 0.3.29) activeresource (3.1.10) activemodel (= 3.1.10) activesupport (= 3.1.10) activesupport (3.1.10) multi_json (>= 1.0, < 1.3) appraisal (0.5.1) bundler rake arel (2.2.3) aruba (0.5.1) childprocess (~> 0.3.6) cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) builder (3.0.4) childprocess (0.3.7) ffi (~> 1.0, >= 1.0.6) coffee-rails (3.1.1) coffee-script (>= 2.2.0) railties (~> 3.1.0) coffee-script (2.2.0) coffee-script-source execjs coffee-script-source (1.4.0) cucumber (1.2.1) builder (>= 2.1.2) diff-lcs (>= 1.1.3) gherkin (~> 2.11.0) json (>= 1.4.6) diff-lcs (1.1.3) erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) factory_girl (4.4.0) activesupport (>= 3.0.0) ffi (1.3.1) gherkin (2.11.6) json (>= 1.7.6) hike (1.2.1) i18n (0.6.1) jquery-rails (2.2.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.7.6) mail (2.3.3) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.19) minitest (4.4.0) minitest-rails (0.3) minitest (~> 4.0) rails (~> 3.0) multi_json (1.2.0) polyglot (0.3.3) rack (1.3.9) rack-cache (1.2) rack (>= 0.4) rack-mount (0.8.3) rack (>= 1.0.0) rack-ssl (1.3.3) rack rack-test (0.6.2) rack (>= 1.0) rails (3.1.10) actionmailer (= 3.1.10) actionpack (= 3.1.10) activerecord (= 3.1.10) activeresource (= 3.1.10) activesupport (= 3.1.10) bundler (~> 1.0) railties (= 3.1.10) railties (3.1.10) actionpack (= 3.1.10) activesupport (= 3.1.10) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.6) rake (10.0.3) rdoc (3.12) json (~> 1.4) rspec (2.11.0) rspec-core (~> 2.11.0) rspec-expectations (~> 2.11.0) rspec-mocks (~> 2.11.0) rspec-core (2.11.1) rspec-expectations (2.11.3) diff-lcs (~> 1.1.3) rspec-mocks (2.11.3) rspec-rails (2.11.4) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) rspec (~> 2.11.0) sass (3.2.5) sass-rails (3.1.7) actionpack (~> 3.1.0) railties (~> 3.1.0) sass (>= 3.1.10) tilt (~> 1.3.2) sprockets (2.0.4) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.7) therubyrhino (2.0.2) therubyrhino_jar (>= 1.7.3) therubyrhino_jar (1.7.4) thor (0.14.6) tilt (1.3.3) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.35) uglifier (1.3.0) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) PLATFORMS ruby DEPENDENCIES activerecord-jdbcsqlite3-adapter (~> 1.2.5) appraisal (~> 0.5.0) aruba (~> 0.5.1) coffee-rails cucumber (~> 1.2.1) factory_girl_rails! jquery-rails minitest-rails rails (= 3.1.10) rake rspec (~> 2.11.0) rspec-rails sass-rails sqlite3 (>= 1.3.4) therubyrhino uglifier factory_girl_rails-4.4.1/gemfiles/rails3.2.gemfile0000644000004100000410000000054512310315200022077 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rails", "3.2.11" gem "sass-rails" gem "coffee-rails" gem "uglifier" gem "sqlite3", ">= 1.3.4", :platforms=>:mri gem "activerecord-jdbcsqlite3-adapter", "~> 1.2.5", :platforms=>:jruby gem "minitest-rails" gem "therubyrhino" gem "jquery-rails" gem "rspec-rails" gemspec :path=>"../"factory_girl_rails-4.4.1/gemfiles/rails3.1.gemfile0000644000004100000410000000054512310315200022076 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "rails", "3.1.10" gem "sass-rails" gem "coffee-rails" gem "uglifier" gem "sqlite3", ">= 1.3.4", :platforms=>:mri gem "activerecord-jdbcsqlite3-adapter", "~> 1.2.5", :platforms=>:jruby gem "minitest-rails" gem "therubyrhino" gem "jquery-rails" gem "rspec-rails" gemspec :path=>"../"factory_girl_rails-4.4.1/gemfiles/rails3.2.gemfile.lock0000644000004100000410000000743312310315200023031 0ustar www-datawww-dataPATH remote: /Users/joshuaclayton/dev/gems/factory_girl_rails specs: factory_girl_rails (4.4.1) factory_girl (~> 4.4.0) railties (>= 3.0.0) GEM remote: https://rubygems.org/ specs: actionmailer (3.2.11) actionpack (= 3.2.11) mail (~> 2.4.4) actionpack (3.2.11) activemodel (= 3.2.11) activesupport (= 3.2.11) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) rack (~> 1.4.0) rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) activemodel (3.2.11) activesupport (= 3.2.11) builder (~> 3.0.0) activerecord (3.2.11) activemodel (= 3.2.11) activesupport (= 3.2.11) arel (~> 3.0.2) tzinfo (~> 0.3.29) activeresource (3.2.11) activemodel (= 3.2.11) activesupport (= 3.2.11) activesupport (3.2.11) i18n (~> 0.6) multi_json (~> 1.0) appraisal (0.5.1) bundler rake arel (3.0.2) aruba (0.5.1) childprocess (~> 0.3.6) cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) builder (3.0.4) childprocess (0.3.7) ffi (~> 1.0, >= 1.0.6) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs coffee-script-source (1.4.0) cucumber (1.2.1) builder (>= 2.1.2) diff-lcs (>= 1.1.3) gherkin (~> 2.11.0) json (>= 1.4.6) diff-lcs (1.1.3) erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) factory_girl (4.4.0) activesupport (>= 3.0.0) ffi (1.3.1) gherkin (2.11.6) json (>= 1.7.6) hike (1.2.1) i18n (0.6.1) journey (1.0.4) jquery-rails (2.2.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.7.6) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.19) minitest (4.4.0) minitest-rails (0.3) minitest (~> 4.0) rails (~> 3.0) multi_json (1.5.0) polyglot (0.3.3) rack (1.4.4) rack-cache (1.2) rack (>= 0.4) rack-ssl (1.3.3) rack rack-test (0.6.2) rack (>= 1.0) rails (3.2.11) actionmailer (= 3.2.11) actionpack (= 3.2.11) activerecord (= 3.2.11) activeresource (= 3.2.11) activesupport (= 3.2.11) bundler (~> 1.0) railties (= 3.2.11) railties (3.2.11) actionpack (= 3.2.11) activesupport (= 3.2.11) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rake (10.0.3) rdoc (3.12) json (~> 1.4) rspec (2.11.0) rspec-core (~> 2.11.0) rspec-expectations (~> 2.11.0) rspec-mocks (~> 2.11.0) rspec-core (2.11.1) rspec-expectations (2.11.3) diff-lcs (~> 1.1.3) rspec-mocks (2.11.3) rspec-rails (2.11.4) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) rspec (~> 2.11.0) sass (3.2.5) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.7) therubyrhino (2.0.2) therubyrhino_jar (>= 1.7.3) therubyrhino_jar (1.7.4) thor (0.17.0) tilt (1.3.3) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.35) uglifier (1.3.0) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) PLATFORMS ruby DEPENDENCIES activerecord-jdbcsqlite3-adapter (~> 1.2.5) appraisal (~> 0.5.0) aruba (~> 0.5.1) coffee-rails cucumber (~> 1.2.1) factory_girl_rails! jquery-rails minitest-rails rails (= 3.2.11) rake rspec (~> 2.11.0) rspec-rails sass-rails sqlite3 (>= 1.3.4) therubyrhino uglifier factory_girl_rails-4.4.1/metadata.yml0000644000004100000410000001143112310315200017714 0ustar www-datawww-data--- !ruby/object:Gem::Specification name: factory_girl_rails version: !ruby/object:Gem::Version version: 4.4.1 platform: ruby authors: - Joe Ferris autorequire: bindir: bin cert_chain: [] date: 2014-02-26 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: railties requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 3.0.0 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 3.0.0 - !ruby/object:Gem::Dependency name: factory_girl requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 4.4.0 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 4.4.0 - !ruby/object:Gem::Dependency name: appraisal requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 0.5.0 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 0.5.0 - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency name: rspec requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 2.11.0 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 2.11.0 - !ruby/object:Gem::Dependency name: cucumber requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 1.2.1 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 1.2.1 - !ruby/object:Gem::Dependency name: aruba requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 0.5.1 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: 0.5.1 description: |- factory_girl_rails provides integration between factory_girl and rails 3 (currently just automatic factory definition loading) email: jferris@thoughtbot.com executables: [] extensions: [] extra_rdoc_files: [] files: - ".gitignore" - ".travis.yml" - Appraisals - CONTRIBUTING.md - Gemfile - LICENSE - NEWS - README.md - Rakefile - factory_girl_rails.gemspec - features/fixture_replacement_config.feature - features/generators.feature - features/load_definitions.feature - features/step_definitions/appraisal.rb - features/step_definitions/rails_steps.rb - features/support/env.rb - gemfiles/rails3.1.gemfile - gemfiles/rails3.1.gemfile.lock - gemfiles/rails3.2.gemfile - gemfiles/rails3.2.gemfile.lock - lib/factory_girl_rails.rb - lib/factory_girl_rails/generator.rb - lib/factory_girl_rails/generators/non_rspec_generator.rb - lib/factory_girl_rails/generators/null_generator.rb - lib/factory_girl_rails/generators/rspec_generator.rb - lib/factory_girl_rails/railtie.rb - lib/generators/factory_girl.rb - lib/generators/factory_girl/model/model_generator.rb - lib/generators/factory_girl/model/templates/fixtures.erb homepage: http://github.com/thoughtbot/factory_girl_rails licenses: - MIT metadata: {} post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 2.2.0 signing_key: specification_version: 4 summary: factory_girl_rails provides integration between factory_girl and rails 3 test_files: - Appraisals - features/fixture_replacement_config.feature - features/generators.feature - features/load_definitions.feature - features/step_definitions/appraisal.rb - features/step_definitions/rails_steps.rb - features/support/env.rb - gemfiles/rails3.1.gemfile - gemfiles/rails3.1.gemfile.lock - gemfiles/rails3.2.gemfile - gemfiles/rails3.2.gemfile.lock factory_girl_rails-4.4.1/.gitignore0000644000004100000410000000012212310315200017374 0ustar www-datawww-data*.swp test.db factory_girl_rails-*.gem tmp rdoc coverage pkg .bundle Gemfile.lock factory_girl_rails-4.4.1/CONTRIBUTING.md0000644000004100000410000000247012310315200017645 0ustar www-datawww-dataWe love pull requests. Here's a quick guide: 1. Fork the repo. 2. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: `bundle && rake` 3. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test! 4. Make the test pass. 5. Push to your fork and submit a pull request. At this point you're waiting on us. We like to at least comment on, if not accept, pull requests within three business days (and, typically, one business day). We may suggest some changes or improvements or alternatives. Some things that will increase the chance that your pull request is accepted, taken straight from the Ruby on Rails guide: * Use Rails idioms and helpers * Include tests that fail without your code, and pass with it * Update the documentation, the surrounding one, examples elsewhere, guides, whatever is affected by your contribution Syntax: * Two spaces, no tabs. * No trailing whitespace. Blank lines should not have any space. * Prefer &&/|| over and/or. * MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg. * a = b and not a=b. * Follow the conventions you see used in the source already. And in case we didn't emphasize it enough: we love tests! factory_girl_rails-4.4.1/LICENSE0000644000004100000410000000207012310315200016415 0ustar www-datawww-dataCopyright (c) 2008-2013 Joe Ferris and thoughtbot, inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. factory_girl_rails-4.4.1/Appraisals0000644000004100000410000000115512310315200017435 0ustar www-datawww-dataappraise "rails3.1" do gem "rails", "3.1.10" gem "sass-rails" gem "coffee-rails" gem "uglifier" gem "sqlite3", ">= 1.3.4", platforms: :mri gem "activerecord-jdbcsqlite3-adapter", "~> 1.2.5", platforms: :jruby gem "minitest-rails" gem "therubyrhino" gem "jquery-rails" gem "rspec-rails" end appraise "rails3.2" do gem "rails", "3.2.11" gem "sass-rails" gem "coffee-rails" gem "uglifier" gem "sqlite3", ">= 1.3.4", platforms: :mri gem "activerecord-jdbcsqlite3-adapter", "~> 1.2.5", platforms: :jruby gem "minitest-rails" gem "therubyrhino" gem "jquery-rails" gem "rspec-rails" end factory_girl_rails-4.4.1/checksums.yaml.gz0000444000004100000410000000041512310315200020677 0ustar www-datawww-datah Se;N@ "Z9륢A8=%H,߼vy{zGx:L|8~EHY 3˱__\ z\a8gz2A=ՖQc{H:5`.64&A+<护\q̫%' ^)N@*gC0iop%;LQ]8l9j{0:8GgV g–.b:quHd&Jvfactory_girl_rails-4.4.1/README.md0000644000004100000410000000455012310315200016674 0ustar www-datawww-datafactory_girl [![Build Status](https://secure.travis-ci.org/thoughtbot/factory_girl_rails.png)](http://travis-ci.org/thoughtbot/factory_girl_rails?branch=master) ============ `factory_girl` is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (`user`, `admin_user`, and so on), including factory inheritance. Rails ----- `factory_girl_rails` provides Rails integration for `factory_girl`. All Rails-specific features are only compatible with Rails 3. Currently, automatic factory definition loading is the only Rails-specific feature. Download -------- Github: http://github.com/thoughtbot/factory_girl_rails/tree/master Gem: gem install factory_girl_rails Configuration ------------- Add `factory_girl_rails` to your Gemfile: gem 'factory_girl_rails' Generators for factories will automatically substitute fixture (and maybe any other `fixture_replacement` you set). If you want to disable this feature, add the following to your application.rb file: config.generators do |g| g.factory_girl false end Default factories directory is `test/factories`, or `spec/factories` if `test_framework` generator is set to `:rspec`; change this behavior with: config.generators do |g| g.factory_girl dir: 'custom/dir/for/factories' end If you use `factory_girl` for fixture replacement, ensure that `factory_girl_rails` is available in the development group. If it's not, Rails will generate standard yml files instead of factory files. `factory_girl` takes an option `suffix: 'some_suffix'` to generate factories as "modelname_some_suffix.rb" More Information ---------------- factory_girl: http://github.com/thoughtbot/factory_girl/tree/master Contributing ------------ Please see CONTRIBUTING.md for details. Credits ------- factory_girl was originally written by Joe Ferris. ![thoughtbot](http://thoughtbot.com/images/tm/logo.png) factory_girl is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community) The names and logos for thoughtbot are trademarks of thoughtbot, inc. License ------- factory_girl is Copyright © 2008-2013 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.