0

I want to run my command line tool in a project against another project to analyze Cucumber tests. Both projects have their own gemsets.

When I execute Cucumber pointing to the other project, then it tries to execute using my gemset/configuration, then it fails.

How can I "change scope/context" to make Cucumber run in the other project folder (and use its own Gemfile and configuration)?

4

2 回答 2

1

像下面这样的东西应该可以工作:

 Bundler.with_clean_env do
   system("cd other/project; bundle exec cucumber")
 end
于 2013-05-05T11:20:31.927 回答
0

“快速而肮脏”的解决方案是进行系统调用,然后进入主项目目录;运行bundle install;然后cucumber features/

system("cd other/project && bundle install && bundle exec cucumber features/")

于 2013-05-06T22:31:32.357 回答