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:, request:) ⇒ Launcher

Returns a new instance of Launcher.



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

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

Instance Method Details

#launchObject



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

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} && bundle exec 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