Search code examples
ruby-on-rails-3cucumberguard

Guard + cucumber => custom guard file


I'm trying to correctly setup my guard file in order to normally only run cucumber features that are in progress. Then, once they have completed, I want to run all of my features (manually). I have modified my guard file to have this, but the run_all isn't working. It just runs the @wip features.

guard 'cucumber', :cli => "--no-profile --tags @wip --format 'pretty'", :run_all => { :cli => "--no-profile --color --format 'progress' --strict" } do
  watch(%r{^features/.+\.feature$})
  watch(%r{^features/support/.+$})          { 'features' }
  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end

How does the :run_all method work?


Solution

  • Ended up having to define the format for each.

    guard 'cucumber', :cli => "--no-profile --tags @wip --format 'pretty'", :run_all => { :cli => "--no-profile -f Cucumber::Formatter::Fuubar features" } do
      watch(%r{^features/.+\.feature$})
      watch(%r{^features/support/.+$})          { 'features' }
      watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
    end