Class: Kender::Cucumber

Inherits:
Command show all
Defined in:
lib/kender/commands/cucumber.rb

Instance Attribute Summary

Attributes inherited from Command

#success

Instance Method Summary collapse

Methods inherited from Command

all, all_names, all_success?, commands, #execute, inherited, #name, #run

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/kender/commands/cucumber.rb', line 4

def available?
  %w[cucumber cucumber-rails].any? { |gem| in_gemfile?(gem) } && !ENV['VALIDATE_PROJECT']
end

#commandObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kender/commands/cucumber.rb', line 8

def command
  extra_env = ENV['HEADED_BROWSER'] ? "HEADED_BROWSER=#{ENV['HEADED_BROWSER']}" : ''
  if defined?(Knapsack)
    knapsack_env = "CI_NODE_TOTAL=#{ENV['CI_NODE_TOTAL']} CI_NODE_INDEX=#{ENV['CI_NODE_INDEX']}"
    "#{extra_env} #{knapsack_env} bundle exec rake knapsack:cucumber"
  elsif defined?(ParallelTests)
    "#{extra_env} bundle exec rake parallel:features"
  else
    "#{extra_env} bundle exec cucumber"
  end
end