Use construct for stubbing user_dir.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user