lib/henry/task/rspec_task.rb in henry-container-0.0.44 vs lib/henry/task/rspec_task.rb in henry-container-0.0.45
- old
+ new
@@ -32,20 +32,20 @@
# Configures the Task.
#
# @param [Hash] params the task params.
def configure(params)
- File.open('rspec.out', 'w') { |f| }
+ File.open(OUT_PATH, 'w') { |f| }
# Makes available the spec rake task.
RSpec::Core::RakeTask.new do |t|
if self.data.options
t.pattern = self.data.options['pattern'] || 'spec/*'
t.rspec_opts = self.custom_options
else
t.pattern = 'spec/*'
- t.rspec_opts = "--out #{OUT_PATH}"
+ t.rspec_opts = self.default_options
end
end
self.export_params(params)
end
@@ -57,16 +57,23 @@
# @return [String]
def custom_options
"#{self.format_options} #{self.report_options}"
end
+ # Returns the default rspec_opts.
+ #
+ # @return [String]
+ def default_options
+ "--format documentation --out #{OUT_PATH}"
+ end
+
# Returns the rspec_opts related with formatting.
#
# @return [String]
def format_options
"--format #{self.data.options['format'] || 'documentation'} --out #{OUT_PATH}"
end
-
+
# Returns the rspec_opts related with report paaths and formats.
#
# @return [String]
def report_options
return '' if self.data.reports.nil?