Guardfile for running single cucumber feature in subdirectory?

て烟熏妆下的殇ゞ 提交于 2019-12-04 05:26:26

Aph, the answer was right there in the documentation:

It's very important that you understand how Cucumber gets configured, because it's often the origin of strange behavior of guard-cucumber.

Cucumber uses cucumber.yml for defining profiles of specific run configurations. When you pass configurations through the :cli option but don't include a specific profile with --profile, then the configurations from the default profile are also used.

For example, when you're using the default cucumber.yml generated by cucumber-rails, then the default profile forces guard-cucumber to always run all features, because it appends the features folder.

Configure Cucumber solely from Guard

If you want to configure Cucumber from Guard solely, then you should pass --no-profile to the :cli option.

So, passing in --no-profile for the :cli option works now, and I'm getting normal behavior.

Shame on me for not reading the docs!

The --no-profile flag doesn't seem to be needed anymore, furthermore it results in not displaying any information about the run features to the console (e.g. code snippets for not yet implemented steps), which is definitely not what you want.

Today's way to go seems to be to use :all_after_pass flag like this (in your Guardfile):

guard 'cucumber', :cli => '--drb', :all_on_start => false, :all_after_pass => false do

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!