Module: Bulldogger::RerunCommand

Defined in:
lib/bulldogger/rerun_command.rb

Overview

Builds framework test selectors and complete shell rerun commands. Replay execution and process management stay outside this module.

Class Method Summary collapse

Class Method Details

.build(test) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bulldogger/rerun_command.rb', line 11

def build(test)
  return nil unless test && test[:file] && test[:seed]

  arguments = case test[:framework]
              when "minitest"
                minitest_arguments(test)
              when "rspec"
                rspec_arguments(test)
              end
  arguments && Shellwords.join(arguments)
end

.minitest_method(test) ⇒ Object



23
24
25
# File 'lib/bulldogger/rerun_command.rb', line 23

def minitest_method(test)
  test[:id].to_s.split("#", 2)[1]
end

.rspec_location(test) ⇒ Object



27
28
29
# File 'lib/bulldogger/rerun_command.rb', line 27

def rspec_location(test)
  "#{test[:file]}:#{test[:line]}" if test[:file] && test[:line]
end