Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save failed features from #run_all #13

Merged
merged 1 commit into from
Jul 4, 2011

Conversation

lmarburger
Copy link
Contributor

Read and save failed features if #run_all fails. Here's the workflow I'm going for:

  1. Save Feature1
  2. Feature1 -> fail
  3. Save a file somewhere in the codebase
  4. Feature1 -> pass
  5. All features -> Feature2 fail
  6. Save a file somewhere in the codebase
  7. Feature2 -> pass
  8. All features -> pass

From what I can tell, there's no way to tell guard-cucumber to rerun the saved failed features without calling #run_on_change. Here's my Guardfile:

guard 'cucumber', :cli => '--no-profile --drb --color --strict --format progress --format rerun --out rerun.txt',
                  :all_on_start => false do
  watch(%r{^features/.+\.feature$})
  watch(%r{^features/support/.+$}) { 'features' }
  watch(%r{^app/assets/.+$})       { 'features' }

  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
    Dir[File.join("**/#{m[1]}.feature")][0] || 'features'
  end

  # Rerun failed features
  watch('config/routes.rb')
  watch(%r{^app/(.*)\.rb})
end

It's cheating, but I'm passing non-feature filenames to guard-cucumber which it's smart enough to ignore. The end result is when an app file is saved, the failed features are rerun.

I've only started using guard yesterday so please let me know if I'm missing something obvious. I wouldn't be surprised. In the mean time, I'm going to give this patch a try today and see how it feels.

@netzpirat
Copy link
Owner

Thank you very much for your contribution. I looks fine and I'll released version 0.5.2 that includes your changes.

netzpirat added a commit that referenced this pull request Jul 4, 2011
---

Read and save failed features if `#run_all` fails. Heres the workflow Im going for:

1. Save Feature1
2. Feature1 -> fail
3. Save a file somewhere in the codebase
4. Feature1 -> pass
5. All features -> Feature2 fail
6. Save a file somewhere in the codebase
7. Feature2 -> pass
8. All features -> pass

From what I can tell, theres no way to tell guard-cucumber to rerun the saved failed features without calling `#run_on_change`. Heres my Guardfile:

```ruby
guard cucumber, :cli => --no-profile --drb --color --strict --format progress --format rerun --out rerun.txt,
                  :all_on_start => false do
  watch(%r{^features/.+\.feature$})
  watch(%r{^features/support/.+$}) { features }
  watch(%r{^app/assets/.+$})       { features }

  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
    Dir[File.join("**/#{m[1]}.feature")][0] || features
  end

  # Rerun failed features
  watch(config/routes.rb)
  watch(%r{^app/(.*)\.rb})
end
```

Its cheating, but Im passing non-feature filenames to guard-cucumber which its smart enough to ignore. The end result is when an app file is saved, the failed features are rerun.

Ive only started using guard yesterday so please let me know if Im missing something obvious. I wouldnt be surprised. In the mean time, Im going to give this patch a try today and see how it feels.
@netzpirat netzpirat merged commit caf67be into netzpirat:master Jul 4, 2011
@lmarburger
Copy link
Contributor Author

Excellent! Thanks for pulling in the commit. I've been using guard-cucumber in my workflow for a few days now and it's fantastic. I can't believe I waited so long to add it to my projects.

hron pushed a commit to hron/guard-cucumber that referenced this pull request Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants