This is from the Aruba Cucumber api for testing a CLI. I keep getting an error that dotfiles is not a directory. It is a directory but can't figure out why the error is occuring.
From the aruba api:
def current_dir
File.join(*dirs)
end
def dirs
@dirs ||= ['tmp', 'aruba']
end
def cd(dir)
dirs << dir
raise "#{current_dir} is not a directory." unless File.directory?(current_dir)
end
So running Dir.entries(ENV['HOME'])
includes the directory dotfiles
. I know it's there.
"Applications",
"clone",
"Desktop",
"Documents",
"dotfiles",
etc...
Now using the above methods from the aruba api
[6] pry(main)> Dir.pwd
=> "/Users/Brian"
[7] pry(main)> Dir.home
=> "/Users/Brian"
[8] pry(main)> cd(File.join(ENV['HOME'], 'dotfiles'))
RuntimeError: tmp/aruba/Users/Brian/dotfiles is not a directory. # ?????
from /Users/Brian/test_aruba.rb:11:in `cd'
Why is this not seeing dotfiles is a directory?
Any help would be great. thanks