lib/henry/task/cucumber_task.rb in henry-container-0.1.55 vs lib/henry/task/cucumber_task.rb in henry-container-0.1.56
- old
+ new
@@ -73,24 +73,25 @@
# Makes available the cucumber rake task.
Rake.application.clear
Cucumber::Rake::Task.new do |t|
if self.data.options
- t.cucumber_opts = "#{self.custom_options} #{extended_context['options']}"
+ t.cucumber_opts = self.custom_options(extended_context['options'])
else
- t.cucumber_opts = "#{self.default_options()} #{extended_context['options']}"
+ t.cucumber_opts = self.default_options()
end
end
super
end
# Returns the custom cucumber_opts that user may have passed.
#
+ # @param [Hash] extended_options set of extended options.
# @return [String]
- def custom_options
- "#{self.format_options} #{self.tags_options} #{self.report_options} #{self.rerun_options} #{self.misc_options}"
+ def custom_options(extended_options={})
+ "#{self.format_options} #{self.tags_options(extended_options)} #{self.report_options} #{self.rerun_options} #{self.misc_options}"
end
# Returns the miscellaneous cucumber_opts.
#
# @return [String]
@@ -112,14 +113,15 @@
"--format #{self.data.options['format'] || 'pretty'} --format #{self.data.options['format'] || 'pretty'} --out #{OUT_PATH}"
end
# Returns the cucumber_opts related with tags to be run.
#
+ #
# @return [String]
- def tags_options
- return '' if self.data.options['tags'].nil?
+ def tags_options(extended_options={})
+ return '' if self.data.options['tags'].nil? && extended_options['tags'].nil?
- self.data.options['tags'].collect do |tag|
+ ((self.data.options['tags']||[])+(extended_options['tags']||[])).collect do |tag|
"--tags #{tag.gsub(/(,?~?)(\w+)/, '\1@\2')}"
end.join(' ')
end
# Returns the cucumber_opts related with report paaths and formats.