Sha256: aae63367bfe91007b9b4d76de094825ef8f7e180c238c0249372401b8b2c7294
Contents?: true
Size: 1.14 KB
Versions: 12
Compression:
Stored size: 1.14 KB
Contents
# load the application so we can look in mods require APP_PATH require "cardio/command/command_base" require "cardio/mod/dirs" module Decko class Commands class CucumberCommand < Cardio::Command::CommandBase require "decko/commands/cucumber_command/parser" def initialize args @decko_args, @cucumber_args = split_args args @opts = {} Parser.new(@opts).parse!(@decko_args) end def command @cmd ||= "#{env_args} #{@opts[:executer] || 'bundle exec'} " \ "cucumber #{require_args} #{feature_args} #{@cucumber_args.shelljoin}" end private def env_args @opts[:env].join " " end # use implicit features unless feature made explicit (in FIRST arg!) def feature_args feature_paths.join(" ") unless @cucumber_args.first&.match?(/^\s*[^-]/) end def require_args "-r #{Decko.gem_root}/features " + feature_paths.map { |path| "-r #{path}" }.join(" ") end def feature_paths Cardio::Mod.dirs.map do |p| Dir.glob "#{p}/features" end.flatten end end end end
Version data entries
12 entries across 12 versions & 1 rubygems