add some tasks

This commit is contained in:
John Bintz 2012-08-15 16:07:55 -04:00
parent 85140c135d
commit 2afcc53b75
2 changed files with 25 additions and 0 deletions

2
lib/cuke-pack/tasks.rb Normal file
View File

@ -0,0 +1,2 @@
require 'cuke-pack/tasks/any_wip'

View File

@ -0,0 +1,23 @@
namespace :cuke_pack do
desc "Raise an exception if any tasks are marked @wip"
task :any_wip do
require 'gherkin/parser/parser'
require 'gherkin/formatter/json_formatter'
require 'gherkin/formatter/tag_count_formatter'
io = StringIO.new
counts = {}
json_formatter = Gherkin::Formatter::JSONFormatter.new(io)
formatter = Gherkin::Formatter::TagCountFormatter.new(json_formatter, counts)
parser = Gherkin::Parser::Parser.new(formatter)
Dir['features/**/*.feature'].each do |file|
parser.parse(File.read(file), file, 0)
end
if counts['@wip']
raise StandardError.new("@wip occurred in the following files:\n#{counts['@wip'].join("\n")}")
end
end
end