Skip to content

Commit

Permalink
Expand path to repo_root
Browse files Browse the repository at this point in the history
  • Loading branch information
aguynamedryan committed Feb 8, 2011
1 parent 11b6724 commit 6407cb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/nachos/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Nachos
class Config

def repo_root
Pathname(config.repo_root)
Pathname(config.repo_root).expand_path
end

def config
Expand Down Expand Up @@ -30,4 +30,4 @@ def load_config
end

end
end
end
8 changes: 7 additions & 1 deletion spec/nachos/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,4 +36,4 @@
end
end

end
end

0 comments on commit 6407cb3

Please sign in to comment.