0

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

fontno
  • 6,642
  • 6
  • 36
  • 43
  • Could it be a symlink? – millimoose Aug 02 '13 at 22:38
  • @millimoose In the script I am testing, I make (`FileUtils.mkdir`) the `dotfiles` directory right before I `cd` into the the `dotfiles` directory. You can see more detail in the linked question. It has to be something small or silly/obvious but it's driving me crazy – fontno Aug 03 '13 at 20:13
  • possible duplicate of [Cucumber Aruba trying to change directory results in a strange error](http://stackoverflow.com/questions/18009241/cucumber-aruba-trying-to-change-directory-results-in-a-strange-error) – the Tin Man Aug 04 '13 at 14:33
  • Don't create two versions of the same question; Stack Overflow doesn't like duplication. If you don't get a response in the original, find ways to provide better detail and edit it, don't create multiple versions of the same question hoping one will get an answer. – the Tin Man Aug 04 '13 at 14:37
  • Sorry but I don't think this is a "duplicate". I'm asking a question on the same topic but in a completly different way. I think the first question was to complicated to get much response. And thats my fault. I took out the link to the other question. – fontno Aug 04 '13 at 20:45

0 Answers0