1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Remove 1.8.x support

This commit is contained in:
Joshua Clayton 2012-03-09 16:14:06 -05:00
parent cfaa00c980
commit 400c9f193f
12 changed files with 35 additions and 49 deletions

View file

@ -1,6 +1,4 @@
rvm:
- ree-1.8.7
- 1.8.7
- 1.9.2
- 1.9.3
before_install:

View file

@ -55,7 +55,6 @@ GEM
multi_json (1.0.3)
rack (1.3.3)
rake (0.9.2)
rcov (0.9.10)
rdiscount (1.6.8)
rspec (2.6.0)
rspec-core (~> 2.6.0)
@ -65,6 +64,10 @@ GEM
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
simplecov (0.6.1)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sqlite3 (1.3.4)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
@ -85,8 +88,8 @@ DEPENDENCIES
cucumber (~> 1.0.0)
factory_girl!
mocha
rcov
rspec (~> 2.0)
simplecov
sqlite3-ruby
timecop
yard

View file

@ -5,7 +5,6 @@ require 'appraisal'
require 'yard'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
require 'rcov/rcovtask'
Bundler::GemHelper.install_tasks
@ -29,17 +28,6 @@ end
desc "Run the unit and acceptance specs"
task :spec => ['spec:unit', 'spec:acceptance']
desc 'Performs code coverage on the factory_girl plugin.'
RSpec::Core::RakeTask.new(:rcov) do |task|
task.pattern = 'spec/**/*_spec.rb'
task.rcov = true
task.rspec_opts = "--format progress"
task.rcov_opts = %{--exclude osx\/objc,spec,gems\/ --aggregate coverage/coverage.data}
end
desc "Clean files generated by rake tasks"
task :clobber => [:clobber_rcov]
Cucumber::Rake::Task.new(:features) do |t|
t.fork = true
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]

View file

@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- Appraisals {spec,features,gemfiles}/*`.split("\n")
s.require_paths = ['lib']
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
s.authors = ["Josh Clayton", "Joe Ferris"]
s.email = ["jclayton@thoughtbot.com", "jferris@thoughtbot.com"]
@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.add_development_dependency("rspec", "~> 2.0")
s.add_development_dependency("cucumber", "~> 1.0.0")
s.add_development_dependency("timecop")
s.add_development_dependency("rcov")
s.add_development_dependency("simplecov")
s.add_development_dependency("aruba")
s.add_development_dependency("mocha")
s.add_development_dependency("bourne")

View file

@ -1,5 +1,8 @@
PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
require "simplecov"
SimpleCov.start
$: << File.join(PROJECT_ROOT, 'lib')
require 'active_record'

View file

@ -45,8 +45,8 @@ GEM
json (1.5.3)
mocha (0.9.8)
rake
multi_json (1.1.0)
rake (0.9.2)
rcov (0.9.9)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
@ -55,6 +55,10 @@ GEM
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
simplecov (0.6.1)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
@ -75,8 +79,8 @@ DEPENDENCIES
cucumber (~> 1.0.0)
factory_girl!
mocha
rcov
rspec (~> 2.0)
simplecov
sqlite3-ruby
timecop
yard

View file

@ -55,7 +55,6 @@ GEM
multi_json (1.0.3)
rack (1.3.2)
rake (0.9.2)
rcov (0.9.10)
rdiscount (1.6.8)
rspec (2.6.0)
rspec-core (~> 2.6.0)
@ -65,6 +64,10 @@ GEM
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
simplecov (0.6.1)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sqlite3 (1.3.4)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
@ -85,8 +88,8 @@ DEPENDENCIES
cucumber (~> 1.0.0)
factory_girl!
mocha
rcov
rspec (~> 2.0)
simplecov
sqlite3-ruby
timecop
yard

View file

@ -53,7 +53,6 @@ GEM
multi_json (1.0.4)
rack (1.4.0)
rake (0.9.2.2)
rcov (0.9.11)
rdiscount (1.6.8)
rspec (2.8.0)
rspec-core (~> 2.8.0)
@ -63,6 +62,10 @@ GEM
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
simplecov (0.6.1)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sqlite3 (1.3.5)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
@ -83,8 +86,8 @@ DEPENDENCIES
cucumber (~> 1.0.0)
factory_girl!
mocha
rcov
rspec (~> 2.0)
simplecov
sqlite3-ruby
timecop
yard

View file

@ -4,11 +4,7 @@ module FactoryGirl
@name = name
@strategy = strategy
@overrides = if traits_and_overrides.last.respond_to?(:has_key?)
traits_and_overrides.pop
else
{}
end
@overrides = traits_and_overrides.extract_options!
@traits = traits_and_overrides
end

View file

@ -1,19 +1,7 @@
module FactoryGirl
if defined?(::BasicObject)
class NullObject < ::BasicObject
def method_missing(*args)
nil
end
end
else
class NullObject
instance_methods.each do |m|
undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
end
def method_missing(*args)
nil
end
end
end
end

View file

@ -1,5 +1,4 @@
require 'spec_helper'
require 'active_support/ordered_hash'
describe "attribute overrides" do
before do
@ -32,9 +31,7 @@ describe "attribute overrides" do
let(:admin) { FactoryGirl.create(:admin) }
let(:post_attributes) do
attributes = ActiveSupport::OrderedHash.new
attributes[:secure] = false
attributes
{ secure: false }
end
let(:non_admin_post_attributes) do

View file

@ -5,6 +5,9 @@ require 'rubygems'
require 'rspec'
require 'rspec/autorun'
require "simplecov"
SimpleCov.start
require 'factory_girl'
require "mocha"
require "bourne"