From the docs:
Per default Aruba will create a directory tmp/aruba where it performs its file operations.
However, my application uses ENV["HOME"]
to create and read a file (~/.foorc
), so I need Aruba to use a fake ENV["HOME"]
.
Do I need to set it in some support-file, or is there a way to tell Aruba to its tmp/aruba
for files in ENV["HOME"]
?
Here is an excerpt of my code that I am testing (obviously I am testing this with Cucumber/Aruba on a much higher level, but the usage of ENV["HOME"] is what is important here.):
def initialize config_path = ""
if config_path.empty?
@config_path = File.join ENV["HOME"], ".todotxt.cfg"
else
@config_path = config_path
end
if file_exists?
super @config_path
validate
end
end
def file_exists?
File.exists? @config_path
end
#....
ask_to_create unless @config.file_exists?
#...
The Specification:
Scenario: todotxt
Given an empty installation
When I run `todotxt`
Then it should pass with:
"""
Should I create a sample config file? [Y/n]
"""