0

Is there any way to run a single test in ruby under spec/features/abc_spec.rb 'header details' ? Ex:

rake test:features spec/features/abc_spec.rb 'header details'
Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
Rajesh
  • 119
  • 1
  • 8

1 Answers1

1

Since you're using rspec, there are a few ways to run a single test. First, you can just specify the line of the test bundle exec rspec ./spec/features/abc_spec.rb:xx where xx represents the line number of 'header details'. OR You can create tags which is spelled out here in the Rspec docs.

  • I don' want to use rspec. I would like to run with rake command. – Rajesh Aug 23 '17 at 17:43
  • I understand. I assumed you were using rspec considering the file is called *_spec.rb. What test suite are you using? If it is rspec, it should read the line or tag the same as running the rspec command. It really depends on how the Rakefile is written and how your rake task is written. Rake shouldn't be doing anything more than just calling the rspec on a given directory or set of files. – Ryan Workman Aug 24 '17 at 22:41