alexgb / guard-konacha

Automatically run konacha tests through Guard
MIT License
31 stars 17 forks source link

Integrate TDD Workflow #16

Closed matthijsgroen closed 10 years ago

matthijsgroen commented 11 years ago

At Guard RSpec, there is a workflow hidden in the guard strategies:

  1. safe a file or spec. The according testfile is ran 2a. When this test passes, no special stuff 2b. When this test fails, every file trigger should rerun this last failing spec (if no spec file matches)

This results in that when you have a failing spec file, saving a stylesheet or template will rerun this file (so the guard plugin assumes that you save these files to get the spec green)

When this spec file passes, all tests in the suite are ran (which could point you to the next failing spec that needs implementation)

I would like to see this behaviour as well for this plugin, but before I start development for it I want to ask if more people are interested in this behaviour.

alexgb commented 11 years ago

Sounds interesting, where do you see this in Guard RSpec?

matthijsgroen commented 11 years ago

I searched but could not find it as well :-/

Weird but their behavior seems like a really nice TDD flow

At this moment when you would save a template or css file no konacha is run. But what if you would save a template or css file to make your last failing test pass? With the above description we could make that happen.

I also remember when the file passes (when failed earlier) all specs would run, but I can't find any of it in their code.

matthijsgroen commented 11 years ago
describe 'TDD behaviour' do

  context 'when single test file is run' do
     context 'when test file previously failed' do
       it 'reruns the previous file if a file is triggered without a spec'
       it 'runs all the tests if the test does now pass'
     end
     context 'when test file previously passed' do
       it 'does not run any tests if a file is triggered without a spec'
     end
  end

I think this is the behaviour I would like to implement

alexgb commented 11 years ago

+1. It would be good if we documented this behavior I think, even if guard-rspec does not.

matthijsgroen commented 11 years ago

Would a cucumber scenario be more appropriate then?

matthijsgroen commented 11 years ago

Started feature using cucumber, first work in progress (defining the scenario's) can be found here: https://github.com/matthijsgroen/guard-konacha/compare/feature-tdd-behaviour

alexgb commented 11 years ago

I only meant document the behavior in the Readme, but I trust your instinct wrt introducing Cucumber. This looks good to me.

matthijsgroen commented 10 years ago

I noticed i actually don't need this feature anymore. So I stopped the development of it. I will close this.