Method: LearnTest::Strategies::Rspec#configure

Defined in:
lib/learn_test/strategies/rspec.rb

#configureObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/learn_test/strategies/rspec.rb', line 12

def configure
  if format_option_present?
    if dot_rspec.any? {|dot_opt| dot_opt.match(/--format|-f/)}
      argv << dot_rspec.reject {|dot_opt| dot_opt.match(/--format|-f/)}
    else
      argv << dot_rspec
    end
    argv.flatten!
  else
    argv.unshift('--format documentation')
  end

  if fail_fast_option_present?
    argv << '--fail-fast'
  end

  if example_option_present?
    argv << options[:example].map{|e| "--example #{e}"}.join(" ")
  end

  # Don't pass the test/local flag from learn binary to rspec runner.
  argv.delete("--test")
  argv.delete("-t")
  argv.delete("-l")
  argv.delete("--local")
end