Browse files

Expand path to repo_root

  • Loading branch information...
1 parent 11b6724 commit 6407cb31163db264eecccdfe27381042cb442330 aguynamedryan committed Feb 7, 2011
Showing with 9 additions and 3 deletions.
  1. +2 −2 lib/nachos/config.rb
  2. +7 −1 spec/nachos/config_spec.rb
View
4 lib/nachos/config.rb
@@ -2,7 +2,7 @@ class Nachos
class Config
def repo_root
- Pathname(config.repo_root)
+ Pathname(config.repo_root).expand_path
end
def config
@@ -30,4 +30,4 @@ def load_config
end
end
-end
+end
View
8 spec/nachos/config_spec.rb
@@ -15,6 +15,12 @@
config = Nachos::Config.new
config.repo_root.should == Pathname(ENV["HOME"]).join("src")
end
+
+ it "expands a relative path" do
+ config = Nachos::Config.new
+ config.config.repo_root = "~/"
+ config.repo_root.should == Pathname("~/").expand_path
+ end
end
describe "config" do
@@ -30,4 +36,4 @@
end
end
-end
+end

0 comments on commit 6407cb3

Please sign in to comment.