I'm using Cucumber and Aruba to test a Ruby command line app written on top of GLI. To prevent tests from affecting production data, I update ENV['HOME']
to point to a testing directory. I'd like to check for the existence of a file in the testing ENV['HOME']
directory. I'd like to use Aruba for this, but I have been unable to get ENV['HOME']
to expand properly.
For example:
Scenario: Testing config files are found
Given I switch ENV['HOME'] to be "set_a" of test_arena
Then a file named "#{ENV['HOME']}/config.xml" should exist
Is it possible to pass ENV['HOME'] to Aruba's Then a file named "" should exist
step_definition and have it expand to the full path?