Skip to content

Commit

Permalink
switch to Appraisals for testing multiple versions of Rails
Browse files Browse the repository at this point in the history
  • Loading branch information
nathany committed Jun 25, 2013
1 parent 82051c4 commit a99299b
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 52 deletions.
9 changes: 9 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
appraise "rails3" do
gem "rails", "~> 3.2.13"
gem "sass-rails", "~> 3.2.6"
end

appraise "rails4" do
gem "rails", "4.0.0"
gem "sass-rails", "4.0.0"
end
24 changes: 5 additions & 19 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,26 @@ source "http://rubygems.org"
# development dependencies will be added by default to the :development group.
gemspec

# support multiple rails versions
# http://schneems.com/post/50991826838/testing-against-multiple-rails-versions
rails_version = ENV["RAILS_VERSION"] || "default"

rails = case rails_version
when "master"
{github: "rails/rails"}
when "default"
"3.2.13"
else
"~> #{rails_version}"
end
gem "rails", rails

sass_version = ENV["SASS_VERSION"] || ">= 3.1"

# jquery-rails is used by the dummy application
gem "jquery-rails"
gem "pg"
gem "ice_cube"

group :development do
gem "pry"
end

group :test do
gem "rspec-rails", "2.13.0"
gem "rspec", "2.13.0"
gem "spork", "~> 0.9.2"
gem "guard"
gem "guard-spork"
gem "guard-rspec"

gem 'rb-fsevent', :require => false
end

group :assets do
gem "sass-rails", sass_version
gem "sass-rails"
gem "coffee-rails"
gem "uglifier"
end
7 changes: 5 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ GEM
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
appraisal (0.5.2)
bundler
rake
arel (3.0.2)
builder (3.0.4)
childprocess (0.3.9)
Expand Down Expand Up @@ -165,6 +168,7 @@ PLATFORMS
ruby

DEPENDENCIES
appraisal
coffee-rails
guard
guard-rspec
Expand All @@ -173,11 +177,10 @@ DEPENDENCIES
jquery-rails
pg
pry
rails (= 3.2.13)
rb-fsevent
recurring_select!
rspec (= 2.13.0)
rspec-rails (= 2.13.0)
sass-rails (>= 3.1)
sass-rails
spork (~> 0.9.2)
uglifier
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ love to get jasmine running also, but haven't had time yet.
Tests can be ran against different versions of Rails like so:

```
RAILS_VERSION=4.0.0 SASS_VERSION=4.0.0 bundle update
RAILS_VERSION=4.0.0 SASS_VERSION=4.0.0 bundle exec rspec spec
rake appraisal:install
rake appraisal
```


Feel free to open issues or send pull requests.

Licensing
Expand Down
39 changes: 12 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end
require 'rubygems'
require 'bundler/setup'
require 'appraisal'

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec

require 'rubygems/package_task'
Bundler::GemHelper.install_tasks

require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'RecurringSelect'
Expand All @@ -20,20 +19,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end

APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'


Bundler::GemHelper.install_tasks

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end


task :default => :test
11 changes: 11 additions & 0 deletions gemfiles/rails3.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "jquery-rails"
gem "pg"
gem "ice_cube"
gem "rails", "~> 3.2.13"
gem "sass-rails", "~> 3.2.6"

gemspec :path=>"../"
133 changes: 133 additions & 0 deletions gemfiles/rails3.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
PATH
remote: /Users/nathany/Dropbox/Development/jobber/recurring_select
specs:
recurring_select (1.0.2)
coffee-rails (>= 3.1)
ice_cube (>= 0.8)
jquery-rails
rails (>= 3.1)
sass-rails (>= 3.1)

GEM
remote: http://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)
appraisal (0.5.2)
bundler
rake
arel (3.0.2)
builder (3.0.4)
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.6.2)
diff-lcs (1.2.4)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
hike (1.2.3)
i18n (0.6.1)
ice_cube (0.11.0)
journey (1.0.4)
jquery-rails (3.0.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
multi_json (1.7.7)
pg (0.15.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.1.0)
rdoc (3.12.2)
json (~> 1.4)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
sass (3.2.9)
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)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)

PLATFORMS
ruby

DEPENDENCIES
appraisal
ice_cube
jquery-rails
pg
rails (~> 3.2.13)
recurring_select!
rspec (= 2.13.0)
sass-rails (~> 3.2.6)
11 changes: 11 additions & 0 deletions gemfiles/rails4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Appraisal

source "http://rubygems.org"

gem "jquery-rails"
gem "pg"
gem "ice_cube"
gem "rails", "4.0.0"
gem "sass-rails", "4.0.0"

gemspec :path=>"../"
Loading

0 comments on commit a99299b

Please sign in to comment.