Sha256: cda8bf4915ffb79aca7bf23a618e985c328c585b24cb6d221f4d7c4beae27948
Contents?: true
Size: 1.67 KB
Versions: 8
Compression:
Stored size: 1.67 KB
Contents
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 Cucumber::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 = []) begin require 'cucumber' context.existing_cucumber_runtime = context.cucumber_runtime(context, commands) context.cucumber_runtime(context, commands).run! rescue Exception => e context.warning_log "Cucumber library not available", "Unable to use internal cucumber, using external application instead for command #{commands}" context.execute_command(%w(chef exec cucumber) + commands) end # context.bundle_exec(context,['cucumber'] + commands) end def cucumber_test(context) context.git_build(context) context.debug_log "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created in folder #{context.context_folder} at version #{context.version}" context.cucumber(context) end def cucumber_test_successful?(context) result = cucumber_test(context) context.debug_log "\n\nCucumber test result: #{result}" result end end end end
Version data entries
8 entries across 8 versions & 1 rubygems