diff options
author | José Valim <jose.valim@gmail.com> | 2011-06-21 08:02:47 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-06-21 11:24:05 -0300 |
commit | a803aec00d3f7cbe09c3ac0233265754ddd0025f (patch) | |
tree | 85217b234844d680513d6de527fa3b822c41d047 /railties/test/application/configuration_test.rb | |
parent | 8a889dd45e088014c77f4cd799c9e5ddea0b54c6 (diff) | |
download | rails-a803aec00d3f7cbe09c3ac0233265754ddd0025f.tar.gz rails-a803aec00d3f7cbe09c3ac0233265754ddd0025f.tar.bz2 rails-a803aec00d3f7cbe09c3ac0233265754ddd0025f.zip |
Add Rails.groups to encapsulate available groups for require.
Diffstat (limited to 'railties/test/application/configuration_test.rb')
-rw-r--r-- | railties/test/application/configuration_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 477dada820..2547863d12 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -39,6 +39,21 @@ module ApplicationTests FileUtils.rm_rf(new_app) if File.directory?(new_app) end + test "Rails.groups returns available groups" do + require "rails" + + Rails.env = "development" + assert_equal [:default, "development"], Rails.groups + assert_equal [:default, "development", :assets], Rails.groups(:assets => [:development]) + assert_equal [:default, "development", :assets], Rails.groups(:assets => %w(development)) + + Rails.env = "test" + assert_equal [:default, "test"], Rails.groups(:assets => [:development]) + + ENV["RAILS_GROUPS"] = "javascripts,stylesheets" + assert_equal [:default, "test", "javascripts", "stylesheets"], Rails.groups + end + test "Rails.application is nil until app is initialized" do require 'rails' assert_nil Rails.application |