Skip to content

Commit

Permalink
AppName::Application.root should work
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehuda Katz authored and Yehuda Katz committed Jan 3, 2010
1 parent f1cd3a9 commit 106d8f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/application.rb
Expand Up @@ -8,7 +8,7 @@ class Application
class << self class << self
attr_writer :config attr_writer :config
alias configure class_eval alias configure class_eval
delegate :initialize!, :load_tasks, :to => :instance delegate :initialize!, :load_tasks, :root, :to => :instance


private :new private :new
def instance def instance
Expand Down
5 changes: 5 additions & 0 deletions railties/test/application/configuration_test.rb
Expand Up @@ -24,6 +24,11 @@ def setup
assert_equal Pathname.new(app_path), Rails.application.root assert_equal Pathname.new(app_path), Rails.application.root
end end


test "the application root can be seen from the application singleton" do
require "#{app_path}/config/environment"
assert_equal Pathname.new(app_path), AppTemplate::Application.root
end

test "the application root can be set" do test "the application root can be set" do
copy_app copy_app
add_to_config <<-RUBY add_to_config <<-RUBY
Expand Down

0 comments on commit 106d8f7

Please sign in to comment.