middleman/middleman — pull request #1398 by maxmeyer (2014-11-02 16:07:41+00:00)
Title: Switch to current working directory during testing

Hi,

In one of my projects I use some code which depends on the current working directory to be set correctly. My code works fine with `middleman server`, but not with the `cucumber`-step: `When I got to "/XY"`. I think the missing part here is `#in_current_dir`. I found some places where `When I cd to "abc"` is used, but the `current_dir` is not honoured by the steps which use `@browser`.

I know, you set the `MM_ROOT`-variable, but if you use the current working directory in a helper, this does not help. For this code to work the `PWD`-environment-variable needs to be set correctly, which is done by `#in_current_dir` from the `aruba`-project.

This PR makes helpers run in `@browser`-context to have the same working directory like helpers in `middleman server`-context.

Thanks a lot. :-)

Cheers,
maxmeyer