lib/henry/task/cucumber_task.rb in henry-container-0.0.61 vs lib/henry/task/cucumber_task.rb in henry-container-0.0.62
- old
+ new
@@ -1,44 +1,36 @@
-require 'rake'
require 'fileutils'
require 'cucumber/rake/task'
module Henry
class Task
# The Henry Task implementation for Cucumber
- class CucumberTask < Task
+ class CucumberTask < RakeTask
# The temporary output file path for the RspecTask execution.
OUT_PATH = 'cucumber.out'
# The reports path template.
REPORTS_DIR = '.henry/reports/${FORMAT}'
# Default time format to be used in the reports filepath.
TIME_FORMAT = '%Y-%m-%dT%H%M%S'
+
+ # The Cucumber Rake Application name.
+ #
+ # @return [String] the rake application name.
+ APPLICATION_NAME = 'cucumber'
- # Executes the CucumberTask and returns its results.
- def execute
- begin
- Rake.application['cucumber'].invoke
-
- self.execution.code = 'OK'
- self.execution.message = 'OK'
- self.execution.output = File.open(OUT_PATH, 'r').read
- self.execution.log = self.logger.log_as_hash
- rescue Exception => e
-# retry if self.rerun?
+ def application_name
+ APPLICATION_NAME
+ end
- self.execution.code = 'ERROR'
- self.execution.message = 'ERROR'
- self.execution.output = File.open(OUT_PATH, 'r').read
- self.execution.backtrace = e.message
- self.execution.log = self.logger.log_as_hash
- end
+ def out_path
+ OUT_PATH
end
-
+
# Configures the Task.
#
# @param [Hash] params the task params.
# @param [Hash] extended_context task extended context.
def configure(params, extended_context={})