Using WIP acceptance specs
I usually follow the following approaching when working on a story:
- Write a failing acceptance spec.
- Do a spike to validate the proposed solution. Get the spike to pass.
- Capture learnings, and blow away the spike changes.
- Properly TDD away at the solution.
One annoyance with this approach was:
What do I do with the failing acceptance spec?
I usually try not to commit failing specs, since that makes
git bisect less useful when I’m trying to see what broke it.
RSpec tags to the rescue.
Configure your specs to ignore wip specs by default:
RSpec.configure do |c| c.filter_run_excluding wip: true end
Write a WIP spec:
it 'tests my yet-to-be-added feature', :wip do "my test" end
Run the spec:
rspec my_acceptance_spec.rb --tag=wip
The acceptance spec can be committed, because it won’t run as part of your regular test suite.
Once the story is done, make sure you remove the :wip flag!