libraries/deploy-context/deploy/cucumber.rb in deploy-context-2.2.0.3.gec16643.4.g20d2d42.4.g17e8559.12.g831d0a8.4.gbb2ab14 vs libraries/deploy-context/deploy/cucumber.rb in deploy-context-2.2.0.3.gec16643.4.g20d2d42.4.g17e8559.12.g831d0a8.4.gbb2ab14.4.gb48499b
- old
+ new
@@ -1,9 +1,25 @@
module Context
module DeployHelpers
module CucumberHelper
+ def cucumber_configuration(context, commands)
+ context.existing_cucumber_configuration = Cucumber::Cli::Main.new(commands.dup).configuration unless context.existing_cucumber_configuration
+ context.existing_cucumber_configuration
+ end
+
+ def cucumber_runtime(context, commands)
+ return Runtime.new(context.cucumber_configuration(context, commands)) unless context.existing_cucumber_runtime
+
+ context.existing_cucumber_runtime.configure(context.cucumber_configuration(context, commands))
+ context.existing_cucumber_runtime
+ end
+
def cucumber(context, commands = [])
- context.chef_exec(context,['cucumber'] + commands)
+ # context.chef_exec(context,['cucumber'] + commands)
+
+ context.existing_cucumber_runtime = cucumber_runtime(context, commands)
+ # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
+ cucumber_runtime(context, commands).run!
end
def cucumber_test(context)
context.git_build(context)
context.log "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created in folder #{context.context_folder} at version #{context.version}"