pax_global_header00006660000000000000000000000064121437443030014513gustar00rootroot0000000000000052 comment=e42143c375643b429c86ae9e8c71e6699e050cd1 ruby-factory-girl-rails-4.2.1/000077500000000000000000000000001214374430300162105ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/.gitignore000066400000000000000000000001221214374430300201730ustar00rootroot00000000000000*.swp test.db factory_girl_rails-*.gem tmp rdoc coverage pkg .bundle Gemfile.lock ruby-factory-girl-rails-4.2.1/.travis.yml000066400000000000000000000004601214374430300203210ustar00rootroot00000000000000rvm: - 1.9.2 - 1.9.3 - 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.0.gemfile - gemfiles/rails3.1.gemfile - gemfiles/rails3.2.gemfile branches: only: - master ruby-factory-girl-rails-4.2.1/Appraisals000066400000000000000000000015531214374430300202360ustar00rootroot00000000000000appraise "rails3.0" do gem "rails", "3.0.20" 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.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 ruby-factory-girl-rails-4.2.1/CONTRIBUTING.md000066400000000000000000000024701214374430300204440ustar00rootroot00000000000000We 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! ruby-factory-girl-rails-4.2.1/Gemfile000066400000000000000000000000461214374430300175030ustar00rootroot00000000000000source "http://rubygems.org" gemspec ruby-factory-girl-rails-4.2.1/LICENSE000066400000000000000000000020701214374430300172140ustar00rootroot00000000000000Copyright (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. ruby-factory-girl-rails-4.2.1/README.md000066400000000000000000000041121214374430300174650ustar00rootroot00000000000000factory_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' Optionally, to have rails generators automatically generate factories instead of fixtures, add the following to your application.rb file: config.generators do |g| g.fixture_replacement :factory_girl end `fixture_replacement :factory_girl` takes an option `:suffix => 'some_suffix'` to generate factories as "modelname_some_suffix.rb" Cucumber Integration -------------------- factory_girl ships with step definitions for Cucumber integration. For more information, see the GETTING_STARTED file in the factory_girl repo. 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. ruby-factory-girl-rails-4.2.1/Rakefile000066400000000000000000000007411214374430300176570ustar00rootroot00000000000000require '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 ruby-factory-girl-rails-4.2.1/factory_girl_rails.gemspec000066400000000000000000000021321214374430300234310ustar00rootroot00000000000000Gem::Specification.new do |s| s.name = %q{factory_girl_rails} s.version = '4.2.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.add_runtime_dependency('railties', '>= 3.0.0') s.add_runtime_dependency('factory_girl', '~> 4.2.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 ruby-factory-girl-rails-4.2.1/features/000077500000000000000000000000001214374430300200265ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/features/fixture_replacement_config.feature000066400000000000000000000076421214374430300270060ustar00rootroot00000000000000Feature: 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" ruby-factory-girl-rails-4.2.1/features/generators.feature000066400000000000000000000037071214374430300235630ustar00rootroot00000000000000Feature: 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" ruby-factory-girl-rails-4.2.1/features/load_definitions.feature000066400000000000000000000052261214374430300247220ustar00rootroot00000000000000Feature: 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" ruby-factory-girl-rails-4.2.1/features/step_definitions/000077500000000000000000000000001214374430300233745ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/features/step_definitions/appraisal.rb000066400000000000000000000003571214374430300257020ustar00rootroot00000000000000When /^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 -") ruby-factory-girl-rails-4.2.1/features/step_definitions/rails_steps.rb000066400000000000000000000033111214374430300262470ustar00rootroot00000000000000When /^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 ruby-factory-girl-rails-4.2.1/features/support/000077500000000000000000000000001214374430300215425ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/features/support/env.rb000066400000000000000000000007321214374430300226610ustar00rootroot00000000000000require '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 set_env('JAVA_OPTS', "-d32 #{ENV['JAVA_OPTS']}") # force jRuby to use client JVM for faster startup times end end if RUBY_PLATFORM == 'java' ruby-factory-girl-rails-4.2.1/gemfiles/000077500000000000000000000000001214374430300200035ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/gemfiles/rails3.0.gemfile000066400000000000000000000004611214374430300226710ustar00rootroot00000000000000# This file was generated by Appraisal source "http://rubygems.org" gem "rails", "3.0.20" 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=>"../"ruby-factory-girl-rails-4.2.1/gemfiles/rails3.0.gemfile.lock000066400000000000000000000062141214374430300236220ustar00rootroot00000000000000PATH remote: /Users/joshuaclayton/dev/gems/factory_girl_rails specs: factory_girl_rails (4.2.1) factory_girl (~> 4.2.0) railties (>= 3.0.0) GEM remote: http://rubygems.org/ specs: abstract (1.0.0) actionmailer (3.0.20) actionpack (= 3.0.20) mail (~> 2.2.19) actionpack (3.0.20) activemodel (= 3.0.20) activesupport (= 3.0.20) builder (~> 2.1.2) erubis (~> 2.6.6) i18n (~> 0.5.0) rack (~> 1.2.5) rack-mount (~> 0.6.14) rack-test (~> 0.5.7) tzinfo (~> 0.3.23) activemodel (3.0.20) activesupport (= 3.0.20) builder (~> 2.1.2) i18n (~> 0.5.0) activerecord (3.0.20) activemodel (= 3.0.20) activesupport (= 3.0.20) arel (~> 2.0.10) tzinfo (~> 0.3.23) activeresource (3.0.20) activemodel (= 3.0.20) activesupport (= 3.0.20) activesupport (3.0.20) appraisal (0.5.1) bundler rake arel (2.0.10) aruba (0.5.1) childprocess (~> 0.3.6) cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) builder (2.1.2) childprocess (0.3.7) ffi (~> 1.0, >= 1.0.6) 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.6.6) abstract (>= 1.0.0) factory_girl (4.2.0) activesupport (>= 3.0.0) ffi (1.3.1) gherkin (2.11.6) json (>= 1.7.6) i18n (0.5.0) jquery-rails (2.2.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.7.6) mail (2.2.19) activesupport (>= 2.3.6) 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) polyglot (0.3.3) rack (1.2.7) rack-mount (0.6.14) rack (>= 1.0.0) rack-test (0.5.7) rack (>= 1.0) rails (3.0.20) actionmailer (= 3.0.20) actionpack (= 3.0.20) activerecord (= 3.0.20) activeresource (= 3.0.20) activesupport (= 3.0.20) bundler (~> 1.0) railties (= 3.0.20) railties (3.0.20) actionpack (= 3.0.20) activesupport (= 3.0.20) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.4) 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) sqlite3 (1.3.7) therubyrhino (2.0.2) therubyrhino_jar (>= 1.7.3) therubyrhino_jar (1.7.4) thor (0.14.6) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.35) PLATFORMS ruby DEPENDENCIES activerecord-jdbcsqlite3-adapter (~> 1.2.5) appraisal (~> 0.5.0) aruba (~> 0.5.1) cucumber (~> 1.2.1) factory_girl_rails! jquery-rails minitest-rails rails (= 3.0.20) rake rspec (~> 2.11.0) rspec-rails sqlite3 (>= 1.3.4) therubyrhino ruby-factory-girl-rails-4.2.1/gemfiles/rails3.1.gemfile000066400000000000000000000005441214374430300226740ustar00rootroot00000000000000# This file was generated by Appraisal source "http://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=>"../"ruby-factory-girl-rails-4.2.1/gemfiles/rails3.1.gemfile.lock000066400000000000000000000075161214374430300236310ustar00rootroot00000000000000PATH remote: /Users/joshuaclayton/dev/gems/factory_girl_rails specs: factory_girl_rails (4.2.1) factory_girl (~> 4.2.0) railties (>= 3.0.0) GEM remote: http://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.2.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 ruby-factory-girl-rails-4.2.1/gemfiles/rails3.2.gemfile000066400000000000000000000005441214374430300226750ustar00rootroot00000000000000# This file was generated by Appraisal source "http://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=>"../"ruby-factory-girl-rails-4.2.1/gemfiles/rails3.2.gemfile.lock000066400000000000000000000074321214374430300236270ustar00rootroot00000000000000PATH remote: /Users/joshuaclayton/dev/gems/factory_girl_rails specs: factory_girl_rails (4.2.1) factory_girl (~> 4.2.0) railties (>= 3.0.0) GEM remote: http://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.2.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 ruby-factory-girl-rails-4.2.1/lib/000077500000000000000000000000001214374430300167565ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/lib/factory_girl_rails.rb000066400000000000000000000000461214374430300231610ustar00rootroot00000000000000require 'factory_girl_rails/railtie' ruby-factory-girl-rails-4.2.1/lib/factory_girl_rails/000077500000000000000000000000001214374430300226345ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/lib/factory_girl_rails/railtie.rb000066400000000000000000000022561214374430300246170ustar00rootroot00000000000000require 'factory_girl' require 'rails' module FactoryGirl class Railtie < Rails::Railtie initializer "factory_girl.set_fixture_replacement" do generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators rails_options = generators.options[:rails] if rails_options[:test_framework] == :rspec factory_girl_dir = generators.options.fetch(:factory_girl, { :dir => 'spec/factories' })[:dir] if rails_options.has_key?(:fixture_replacement) generators.fixture_replacement rails_options[:fixture_replacement], :dir => factory_girl_dir else generators.fixture_replacement :factory_girl, :dir => factory_girl_dir end else generators.test_framework rails_options[:test_framework], :fixture => false, :fixture_replacement => :factory_girl end 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 end end end ruby-factory-girl-rails-4.2.1/lib/generators/000077500000000000000000000000001214374430300211275ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/lib/generators/factory_girl.rb000066400000000000000000000007071214374430300241440ustar00rootroot00000000000000require '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 ruby-factory-girl-rails-4.2.1/lib/generators/factory_girl/000077500000000000000000000000001214374430300236135ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/lib/generators/factory_girl/model/000077500000000000000000000000001214374430300247135ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/lib/generators/factory_girl/model/model_generator.rb000066400000000000000000000016121214374430300304060ustar00rootroot00000000000000require '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 ruby-factory-girl-rails-4.2.1/lib/generators/factory_girl/model/templates/000077500000000000000000000000001214374430300267115ustar00rootroot00000000000000ruby-factory-girl-rails-4.2.1/lib/generators/factory_girl/model/templates/fixtures.erb000066400000000000000000000004241214374430300312540ustar00rootroot00000000000000# 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 ruby-factory-girl-rails-4.2.1/metadata.yml000066400000000000000000000116701214374430300205200ustar00rootroot00000000000000--- !ruby/object:Gem::Specification name: factory_girl_rails version: !ruby/object:Gem::Version version: 4.2.1 prerelease: platform: ruby authors: - Joe Ferris autorequire: bindir: bin cert_chain: [] date: 2013-02-08 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: railties requirement: !ruby/object:Gem::Requirement none: false requirements: - - ! '>=' - !ruby/object:Gem::Version version: 3.0.0 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement none: false requirements: - - ! '>=' - !ruby/object:Gem::Version version: 3.0.0 - !ruby/object:Gem::Dependency name: factory_girl requirement: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 4.2.0 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 4.2.0 - !ruby/object:Gem::Dependency name: appraisal requirement: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 0.5.0 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 0.5.0 - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement none: false requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement none: false requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency name: rspec requirement: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 2.11.0 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 2.11.0 - !ruby/object:Gem::Dependency name: cucumber requirement: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 1.2.1 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 1.2.1 - !ruby/object:Gem::Dependency name: aruba requirement: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 0.5.1 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version version: 0.5.1 description: ! "factory_girl_rails provides integration between\n factory_girl and rails 3 (currently just automatic factory definition\n loading)" email: jferris@thoughtbot.com executables: [] extensions: [] extra_rdoc_files: [] files: - .gitignore - .travis.yml - Appraisals - CONTRIBUTING.md - Gemfile - LICENSE - 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.0.gemfile - gemfiles/rails3.0.gemfile.lock - 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/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: [] post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement none: false requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement none: false requirements: - - ! '>=' - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 1.8.23 signing_key: specification_version: 3 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.0.gemfile - gemfiles/rails3.0.gemfile.lock - gemfiles/rails3.1.gemfile - gemfiles/rails3.1.gemfile.lock - gemfiles/rails3.2.gemfile - gemfiles/rails3.2.gemfile.lock has_rdoc: