require 'rake' require 'cucumber/rake/task' module Henry class Task # The Henry Task implementation for Cucumber class CucumberTask < Task # Executes the CucumberTask and returns its results. # # @return [Hash] the CucumberTask results. def execute begin Rake.application['cucumber'].invoke self.execution.code = 'OK' self.execution.message = 'OK' self.execution.output = File.open('cucumber.out', 'r').read rescue Exception => e self.execution.code = 'ERROR' self.execution.message = 'ERROR' self.execution.output = File.open('cucumber.out', 'r').read self.execution.backtrace = e.message end end # Configures the Task. # # @param [Hash] params the task params. def configure(params) File.open('cucumber.out', 'w') { |f| } # Makes available the cucumber rake task. Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--out cucumber.out} t.fork = false end self.export_params(params) end end end end