lib/henry/task/rspec_task.rb in henry-container-0.1.58 vs lib/henry/task/rspec_task.rb in henry-container-0.1.59
- old
+ new
@@ -66,11 +66,11 @@
# Makes available the spec rake task.
Rake.application.clear
RSpec::Core::RakeTask.new do |t|
if self.data.options
t.pattern = self.data.options['pattern'] || 'spec/*'
- t.rspec_opts = "#{self.custom_options} #{extended_context['options']}"
+ t.rspec_opts = "#{self.custom_options(extended_context['options']||{})}"
else
t.pattern = 'spec/*'
t.rspec_opts = "#{self.default_options} #{extended_context['options']}"
end
end
@@ -79,22 +79,24 @@
end
protected
# Returns the custom rspec_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}"
+ def custom_options(extended_options={})
+ "#{self.format_options} #{self.tags_options(extended_options)} #{self.report_options}"
end
# Returns the default rspec_opts.
#
# @return [String]
def default_options
"--color --format documentation --format documentation --out #{OUT_PATH}"
end
+
# Returns the rspec_opts related with formatting.
#
# @return [String]
def format_options
@@ -102,13 +104,13 @@
end
# Returns the rspec_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|
"--tag #{tag}"
end.join(' ')
end
# Returns the rspec_opts related with report paaths and formats.