Class: Kender::Rspec

Inherits:
Command show all
Defined in:
lib/kender/commands/rspec.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
7
8
# File 'lib/kender/commands/rspec.rb', line 4

def available?
  # do not run if running shamus
  return false if ENV['VALIDATE_PROJECT']
  in_gemfile?("rspec") || in_gemfile?("rspec-rails")
end

#commandObject


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

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