cucumber/aruba — pull request #186 by dg-vrnetze (2014-06-17 08:36:37+00:00)
Title: Expand paths starting with "~"

Hi there,

@jarl-dk would you mind to review this PR? :-)

I need to place config files in the home directory of the current user. I solved the problem by defining a step which modifies the `ENV['HOME']`-variable before each test and using the `~` to reference the home-directory. The only thing missing is the support in `aruba`. The `File.expand_path`-method is able to expand the `~` to the home-directory by using the `ENV['HOME']`-variable.

I added the `File.expand_path`-method to all `aruba`-method to add support for `~`-expanding in all `aruba`-methods. There's also a step now, which mocks the `ENV['HOME']`-variable.

To make testing a little bit easier I also added two helper `with_env` and `random_string`. The `with_env`-helper uses existing `aruba`-methods to change the process environment during testing for a block of code.