0

When changing Spinach step defined in a Spinach steps file, it is useful to run all those features which use that step.

e.g:

  • I have step 'I have an empty array' do..

    defined in features/steps/test_how_spinach_works.rb

  • I would like to run spinach for every .feature file which includes:

    I have an empty array.

Community
  • 1
  • 1
davetapley
  • 17,000
  • 12
  • 60
  • 86

1 Answers1

3

Assuming you use bash:

  1. Install ack.

  2. Update your ack.rc to include Spinach features:

    --type-set=spinach=.feature`
    
  3. Add the following to your bashrc:

    function ack-spinach() {
      ack --spinach --print0 -l '$1' | xargs -0 spinach
    }
    

You may now run all the features with:

$ ack-spinach 'I have an empty array'
davetapley
  • 17,000
  • 12
  • 60
  • 86