Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Gemfile.lock | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
source :rubygems | ||
gemspec | ||
|
||
ENV['ACTIONPACK_VERSION'] ||= 'master' | ||
ENV['RAILS_VERSION'] ||= 'master' | ||
|
||
if version = ENV['ACTIONPACK_VERSION'] | ||
if version = ENV['RAILS_VERSION'] | ||
if version == 'master' | ||
gem 'actionpack', :github => 'rails/rails' | ||
gem 'activemodel', :github => 'rails/rails' | ||
gem 'journey', :github => 'rails/journey' | ||
gem 'railties', :github => 'rails/rails' | ||
else | ||
gem "actionpack", "~> #{version}" | ||
gem "railties", "~> #{version}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
require 'test/unit' | ||
require 'active_support' | ||
require 'active_support/testing/isolation' | ||
|
||
require 'rails' | ||
# Rails initializers depends on AC and doesn't bother requiring it | ||
require 'action_controller/railtie' | ||
require 'active_support/dependencies' | ||
|
||
require 'sprockets' | ||
require 'sprockets/railtie' | ||
|
||
class TestRailtie < Test::Unit::TestCase | ||
include ActiveSupport::Testing::Isolation | ||
|
||
ROOT = File.expand_path("../../tmp/app", __FILE__) | ||
|
||
attr_reader :app | ||
|
||
def setup | ||
FileUtils.mkdir_p ROOT | ||
Dir.chdir ROOT | ||
|
||
@app = Class.new(Rails::Application) | ||
# Get bitched at if you don't set these | ||
@app.config.eager_load = false | ||
@app.config.time_zone = 'UTC' | ||
@app.config.middleware ||= Rails::Configuration::MiddlewareStackProxy.new | ||
@app.config.active_support.deprecation = :notify | ||
end | ||
|
||
def test_boot | ||
app.initialize! | ||
end | ||
|
||
def test_defaults | ||
app.initialize! | ||
|
||
assert env = app.assets | ||
assert_kind_of Sprockets::Environment, env | ||
|
||
assert_equal ROOT, env.root | ||
assert_equal "development-", env.version | ||
assert env.cache | ||
assert_equal [], env.paths | ||
assert_nil env.js_compressor | ||
assert_nil env.css_compressor | ||
end | ||
|
||
def test_copies_paths | ||
app.configure do | ||
config.assets.paths << "javascripts" | ||
config.assets.paths << "stylesheets" | ||
end | ||
app.initialize! | ||
|
||
assert env = app.assets | ||
assert_equal ["#{ROOT}/javascripts", "#{ROOT}/stylesheets"], | ||
env.paths.sort | ||
end | ||
end |