diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-10-13 17:47:18 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-10-14 11:18:45 -0700 |
commit | d56984c01696348913b298bb65483534035304f0 (patch) | |
tree | 7a547ba570d7522c505f552552154f25d7b0cf8d /railties/test | |
parent | 7ec947d59c1bc3e9772788b757fe70f51b0ffd9b (diff) | |
download | rails-d56984c01696348913b298bb65483534035304f0.tar.gz rails-d56984c01696348913b298bb65483534035304f0.tar.bz2 rails-d56984c01696348913b298bb65483534035304f0.zip |
Make rails configuration's path object's root lazy
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/paths_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/test/paths_test.rb b/railties/test/paths_test.rb index d50882110f..c724799d64 100644 --- a/railties/test/paths_test.rb +++ b/railties/test/paths_test.rb @@ -12,11 +12,32 @@ class PathsTest < ActiveSupport::TestCase assert_equal "/fiz/baz", root.path end + test "the paths object can be initialized with nil" do + assert_nothing_raised do + Rails::Application::Root.new(nil) + end + end + + test "a paths object initialized with nil can be updated" do + root = Rails::Application::Root.new(nil) + root.app = "app" + root.path = "/root" + assert_equal ["/root/app"], root.app.to_a + end + test "creating a root level path" do @root.app = "/foo/bar" assert_equal ["/foo/bar"], @root.app.to_a end + test "raises exception if root path never set" do + root = Rails::Application::Root.new(nil) + root.app = "app" + assert_raises RuntimeError do + root.app.to_a + end + end + test "creating a root level path without assignment" do @root.app "/foo/bar" assert_equal ["/foo/bar"], @root.app.to_a |