Permalink
Browse files

Run only '@focus'-tagged Cucumber features unless none are tagged

This makes Cucumber behave like RSpec with respect to its `:focus => true`
filter.
  • Loading branch information...
1 parent ec7b0d0 commit 911af42d628ea4aaa4701d816f9973a0020d4743 @njonsson committed Mar 6, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 Rakefile
View
6 Rakefile
@@ -22,12 +22,14 @@ def define_features_task(name, options)
end
end
-define_features_task :features, :desc => 'Test features'
-
tags = `grep -Ehr "^\\s*@\\S+\\s*$" features`.split("\n").
collect(&:strip).
uniq.
sort
+options = {:desc => 'Test features'}
+options[:cucumber_opts] = '-t @focus' if tags.delete('@focus')
+define_features_task :features, options
+
unless tags.empty?
namespace :features do
tags.each do |t|

0 comments on commit 911af42

Please sign in to comment.