Permalink
Browse files

Added appraisals to test multiple versions of rails

  • Loading branch information...
1 parent 7f79a64 commit 234f5af6e448e3802e4a6a3b16415f61dfcd6c9d @ghempton ghempton committed Dec 21, 2012
View
8 Appraisals
@@ -0,0 +1,8 @@
+appraise "rails3" do
+ gem 'rails', '~> 3.1'
+end
+
+appraise "rails4" do
+ gem 'rails', :git => 'https://github.com/rails/rails.git'
+ gem 'activerecord-deprecated_finders', :git => 'https://github.com/rails/activerecord-deprecated_finders.git'
+end
View
1 Rakefile
@@ -1,5 +1,6 @@
require "bundler"
Bundler::GemHelper.install_tasks
+require 'appraisal'
require 'rake/testtask'
View
2 ember-rails.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.add_dependency "active_model_serializers"
s.add_dependency "barber"
- s.add_development_dependency "rails", [">= 3.1"]
+ s.add_development_dependency "appraisal"
s.files = %w(README.md LICENSE) + Dir["lib/**/*", "vendor/**/*"]
View
7 gemfiles/rails3.gemfile
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "rails", "~> 3.1"
+
+gemspec :path=>"../"
View
106 gemfiles/rails3.gemfile.lock
@@ -0,0 +1,106 @@
+PATH
+ remote: /Users/ghempton/projects/oss/ember-rails
+ specs:
+ ember-rails (0.8.0)
+ active_model_serializers
+ barber
+ execjs (>= 1.2)
+ railties (>= 3.1)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.2.9)
+ actionpack (= 3.2.9)
+ mail (~> 2.4.4)
+ actionpack (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ 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)
+ active_model_serializers (0.6.0)
+ activemodel (>= 3.0)
+ activemodel (3.2.9)
+ activesupport (= 3.2.9)
+ builder (~> 3.0.0)
+ activerecord (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ activesupport (3.2.9)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ appraisal (0.5.1)
+ bundler
+ rake
+ arel (3.0.2)
+ barber (0.1.2)
+ execjs
+ builder (3.0.4)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ hike (1.2.1)
+ i18n (0.6.1)
+ journey (1.0.4)
+ json (1.7.5)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.5.0)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (3.2.9)
+ actionmailer (= 3.2.9)
+ actionpack (= 3.2.9)
+ activerecord (= 3.2.9)
+ activeresource (= 3.2.9)
+ activesupport (= 3.2.9)
+ bundler (~> 1.0)
+ railties (= 3.2.9)
+ railties (3.2.9)
+ actionpack (= 3.2.9)
+ activesupport (= 3.2.9)
+ 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)
+ sprockets (2.2.2)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ thor (0.16.0)
+ tilt (1.3.3)
+ treetop (1.4.12)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.35)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ appraisal
+ ember-rails!
+ rails (~> 3.1)
View
8 gemfiles/rails4.gemfile
@@ -0,0 +1,8 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "rails", :git=>"https://github.com/rails/rails.git"
+gem "activerecord-deprecated_finders", :git=>"https://github.com/rails/activerecord-deprecated_finders.git"
+
+gemspec :path=>"../"
View
116 gemfiles/rails4.gemfile.lock
@@ -0,0 +1,116 @@
+GIT
+ remote: https://github.com/rails/activerecord-deprecated_finders.git
+ revision: 2125c7b4f959c1aa025f61bdfb5f95b5d6a52b51
+ specs:
+ activerecord-deprecated_finders (0.0.1)
+
+GIT
+ remote: https://github.com/rails/rails.git
+ revision: 48b40ec6faeb6cd4cf2ec0a6df4fa1fe2ee21806
+ specs:
+ actionmailer (4.0.0.beta)
+ actionpack (= 4.0.0.beta)
+ mail (~> 2.5.3)
+ actionpack (4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ builder (~> 3.1.0)
+ erubis (~> 2.7.0)
+ rack (~> 1.4.1)
+ rack-test (~> 0.6.1)
+ activemodel (4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ builder (~> 3.1.0)
+ activerecord (4.0.0.beta)
+ activemodel (= 4.0.0.beta)
+ activerecord-deprecated_finders (= 0.0.1)
+ activesupport (= 4.0.0.beta)
+ arel (~> 3.0.2)
+ activesupport (4.0.0.beta)
+ i18n (~> 0.6)
+ minitest (~> 4.1)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.33)
+ rails (4.0.0.beta)
+ actionmailer (= 4.0.0.beta)
+ actionpack (= 4.0.0.beta)
+ activerecord (= 4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ bundler (>= 1.2.2, < 2.0)
+ railties (= 4.0.0.beta)
+ sprockets-rails (~> 2.0.0.rc1)
+ railties (4.0.0.beta)
+ actionpack (= 4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.15.4, < 2.0)
+
+PATH
+ remote: /Users/ghempton/projects/oss/ember-rails
+ specs:
+ ember-rails (0.8.0)
+ active_model_serializers
+ barber
+ execjs (>= 1.2)
+ railties (>= 3.1)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ active_model_serializers (0.6.0)
+ activemodel (>= 3.0)
+ appraisal (0.5.1)
+ bundler
+ rake
+ arel (3.0.2)
+ atomic (1.0.1)
+ barber (0.1.3)
+ execjs
+ builder (3.1.4)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ hike (1.2.1)
+ i18n (0.6.1)
+ json (1.7.5)
+ mail (2.5.3)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ minitest (4.3.3)
+ multi_json (1.5.0)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rake (10.0.3)
+ rdoc (3.12)
+ json (~> 1.4)
+ sprockets (2.8.2)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.0.0.rc1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
+ thor (0.16.0)
+ thread_safe (0.1.0)
+ atomic
+ tilt (1.3.3)
+ treetop (1.4.12)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.35)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord-deprecated_finders!
+ appraisal
+ ember-rails!
+ rails!
View
6 lib/ember/rails/engine.rb
@@ -14,7 +14,11 @@ class Engine < ::Rails::Engine
require 'ember/filters/slim' if defined? Slim
require 'ember/filters/haml' if defined? Haml
- sprockets = Sprockets.respond_to?('register_engine') ? Sprockets : app.assets
+ sprockets = if ::Rails::VERSION::MAJOR == 4
+ Sprockets.respond_to?('register_engine') ? Sprockets : app.assets
+ else
+ app.assets
+ end
sprockets.register_engine '.handlebars', Ember::Handlebars::Template
sprockets.register_engine '.hbs', Ember::Handlebars::Template
View
3 test/dummy/config/initializers/secret_token.rb
@@ -5,3 +5,6 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Dummy::Application.config.secret_token = '3499a0cb5ffbbcbf4a36f0202d145eac76a1e58ed992b7f7deb659d776b25c658799dbd3b69ecd913ad645e8e694673ae41393d4e6353ae86105f3fc099d7d66'
+
+# Renamed in rails 4
+Dummy::Application.config.secret_key_base = Dummy::Application.config.secret_token
View
6 test/dummy/config/initializers/wrap_parameters.rb
@@ -7,6 +7,6 @@
ActionController::Base.wrap_parameters :format => [:json]
# Disable root element in JSON by default.
-if defined?(ActiveRecord)
- ActiveRecord::Base.include_root_in_json = false
-end
+# if defined?(ActiveRecord)
+# ActiveRecord::Base.include_root_in_json = false
+# end
View
4 test/hjstemplate_test.rb
@@ -5,7 +5,7 @@ class HomeControllerTest < ActionController::TestCase
test "page header should include link to asset" do
get :index
assert_response :success
- assert_select 'head script[type="text/javascript"][src="/assets/templates/test.js"]', true, @response.body
+ assert_select 'head script[src="/assets/templates/test.js"]', true, @response.body
end
end
@@ -63,7 +63,7 @@ def with_template_root(root, sep=nil)
test "should unbind mustache templates" do
get "/assets/templates/hairy.mustache"
assert_response :success
- assert_match /Ember\.TEMPLATES\["hairy"\] = Ember\.Handlebars\.template\(function .*unbound/m, @response.body
+ assert_match /Ember\.TEMPLATES\["hairy(\.mustache)?"\] = Ember\.Handlebars\.template\(function .*unbound/m, @response.body
end
test "ensure new lines inside the anon function are persisted" do

0 comments on commit 234f5af

Please sign in to comment.