Class: TestLauncher::Rubymine::Launcher

Inherits:
Object
  • Object
show all
Defined in:
lib/test_launcher/rubymine/launcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(args:, shell:) ⇒ Launcher

Returns a new instance of Launcher.



7
8
9
10
# File 'lib/test_launcher/rubymine/launcher.rb', line 7

def initialize(args:, shell:)
  @args = args
  @shell = shell
end

Instance Method Details

#launchObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/test_launcher/rubymine/launcher.rb', line 12

def launch
  if args.any? {|a| a.match("ruby-debug-ide")}
    shell.puts "test_launcher: hijacking and debugging"

    debug_command = "cd #{test_case.app_root} && ruby -I test #{args.join(" ")}"
    shell.puts debug_command
    shell.exec debug_command
  else
    shell.puts "test_launcher: hijacking and running:"
    shell.puts command

    shell.exec command
  end
end