Use construct for stubbing user_dir.

This commit is contained in:
Joshua Nichols
2010-03-10 08:31:44 -05:00
parent 7fd44c7fe5
commit 3fb5f5b0d9
2 changed files with 15 additions and 1 deletions

View File

@@ -46,10 +46,15 @@ class Homesick < Thor
protected
def user_dir
# class method, so it's convenient to stub out during tests
def self.user_dir
@user_dir ||= Pathname.new('~').expand_path
end
def user_dir
self.class.user_dir
end
def homes_dir
@homes_dir ||= Pathname.new('~/.homesick/repos').expand_path
end