Permalink
Browse files

Merge pull request #83 from petergoldstein/feature/multi_rails_specs_…

…and_travis

Multiple Rails versions in specs, update Travis, add JRuby to specs
  • Loading branch information...
2 parents ec6085e + 74e3a88 commit f2357dd9e287b6608a3f329b450452a51d5f704e @davidcelis committed Nov 30, 2013
View
@@ -2,6 +2,10 @@
.bundle
vendor/bundle
+# Lockfiles
+gemfiles/*.lock
+Gemfile.lock
+
# logging
*.log
View
@@ -1,6 +1,19 @@
+language: ruby
+services:
+ - redis-server
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
-script: bundle exec rake test
+ - jruby-19mode
+gemfile:
+ - gemfiles/rails_31.gemfile
+ - gemfiles/rails_32.gemfile
+ - gemfiles/rails_40.gemfile
+matrix:
+ exclude:
+ - rvm: 1.8.7
+ gemfile: gemfiles/rails_40.gemfile
+ - rvm: 1.9.2
+ gemfile: gemfiles/rails_40.gemfile
View
@@ -1,2 +1,5 @@
source 'https://rubygems.org/'
gemspec
+
+gem 'sqlite3', :platform => :ruby
+gem 'activerecord-jdbcsqlite3-adapter', :platforms=>:jruby
View
@@ -1,108 +0,0 @@
-PATH
- remote: .
- specs:
- recommendable (2.1.2)
- activesupport (>= 3.0.0)
- hooks (>= 0.2.1)
- redis (>= 2.2.0)
-
-GEM
- remote: https://rubygems.org/
- specs:
- actionmailer (3.2.13)
- actionpack (= 3.2.13)
- mail (~> 2.5.3)
- actionpack (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.5)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.2.1)
- activemodel (3.2.13)
- activesupport (= 3.2.13)
- builder (~> 3.0.0)
- activerecord (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- activesupport (3.2.13)
- i18n (= 0.6.1)
- multi_json (~> 1.0)
- arel (3.0.2)
- builder (3.0.4)
- database_cleaner (0.9.1)
- erubis (2.7.0)
- hike (1.2.1)
- hooks (0.2.2)
- i18n (0.6.1)
- journey (1.0.4)
- json (1.7.7)
- mail (2.5.3)
- i18n (>= 0.4.0)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.21)
- miniskirt (1.2.1)
- activesupport
- minitest (4.6.2)
- multi_json (1.7.1)
- polyglot (0.3.3)
- rack (1.4.5)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.3)
- rack
- rack-test (0.6.2)
- rack (>= 1.0)
- rails (3.2.13)
- actionmailer (= 3.2.13)
- actionpack (= 3.2.13)
- activerecord (= 3.2.13)
- activeresource (= 3.2.13)
- activesupport (= 3.2.13)
- bundler (~> 1.0)
- railties (= 3.2.13)
- railties (3.2.13)
- actionpack (= 3.2.13)
- activesupport (= 3.2.13)
- 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.2)
- json (~> 1.4)
- redis (3.0.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)
- thor (0.17.0)
- tilt (1.3.6)
- treetop (1.4.12)
- polyglot
- polyglot (>= 0.3.1)
- tzinfo (0.3.37)
- yard (0.8.5.2)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- database_cleaner
- miniskirt
- minitest
- rails (>= 3.1.0)
- recommendable!
- sqlite3
- yard
@@ -0,0 +1,7 @@
+source 'https://rubygems.org/'
+gemspec :path => '../'
+
+gem 'rails', '~> 3.1.12'
+
+gem 'sqlite3', :platform => :ruby
+gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
@@ -0,0 +1,7 @@
+source 'https://rubygems.org/'
+gemspec :path => '../'
+
+gem 'rails', '~> 3.2.15'
+
+gem 'sqlite3', :platform => :ruby
+gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
@@ -0,0 +1,7 @@
+source 'https://rubygems.org/'
+gemspec :path => '../'
+
+gem 'rails', '~> 4.0.1'
+
+gem 'sqlite3', :platform => :ruby
+gem 'activerecord-jdbcsqlite3-adapter', :platforms=>:jruby
View
@@ -24,10 +24,9 @@ EOF
s.add_dependency 'redis', '>= 2.2.0'
s.add_dependency 'hooks', '>= 0.2.1'
- s.add_development_dependency 'minitest'
+ s.add_development_dependency 'minitest', '~> 4.2'
s.add_development_dependency 'miniskirt'
s.add_development_dependency 'yard'
s.add_development_dependency 'rails', '>= 3.1.0'
- s.add_development_dependency 'sqlite3'
s.add_development_dependency 'database_cleaner'
end
@@ -1,3 +1,3 @@
class Book < ActiveRecord::Base
- attr_accessible :author, :title
+ attr_accessible :author, :title if ::ActiveRecord::VERSION::MAJOR < 4
end
@@ -1,3 +1,3 @@
class Movie < ActiveRecord::Base
- attr_accessible :title, :year
+ attr_accessible :title, :year if ::ActiveRecord::VERSION::MAJOR < 4
end
@@ -1,3 +1,3 @@
class Rock < ActiveRecord::Base
- attr_accessible :name
+ attr_accessible :name if ::ActiveRecord::VERSION::MAJOR < 4
end
@@ -1,4 +1,4 @@
class User < ActiveRecord::Base
- attr_accessible :email
+ attr_accessible :email if ::ActiveRecord::VERSION::MAJOR < 4
recommends :movies, :books
end
@@ -51,7 +51,7 @@ class Application < Rails::Application
# This will create an empty whitelist of attributes available for mass-assignment for all models
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
# parameters by using an attr_accessible or attr_protected declaration.
- config.active_record.whitelist_attributes = true
+ config.active_record.whitelist_attributes = true if ::ActiveRecord::VERSION::MAJOR < 4
# Enable the asset pipeline
config.assets.enabled = true
@@ -5,9 +5,7 @@
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
-
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
+ config.eager_load = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
@@ -22,8 +20,10 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
+ if (::ActiveRecord::VERSION::MAJOR == 3) && (::ActiveRecord::VERSION::MINOR == 2)
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+ end
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
@@ -6,14 +6,12 @@
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
+ config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
- # Log error messages when you accidentally call methods on nil
- config.whiny_nils = true
-
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
@@ -29,8 +27,10 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
+ if (::ActiveRecord::VERSION::MAJOR == 3) && (::ActiveRecord::VERSION::MINOR == 2)
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+ end
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
View
@@ -1,11 +1,10 @@
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
-require 'rails/test_help'
+require 'minitest/autorun'
require 'minitest/unit'
require 'minitest/pride'
-require 'minitest/autorun'
require 'database_cleaner'

0 comments on commit f2357dd

Please sign in to comment.