Class: AppCommand::Test

Inherits:
Convoy::ActionCommand::Base
  • Object
show all
Defined in:
lib/routes/test.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
# File 'lib/routes/test.rb', line 5

def execute

    @opts = command_options
    @args = arguments
    opts_validate
    opts_routing

end

#opts_routingObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/routes/test.rb', line 24

def opts_routing

    if @opts[:cucumber]
        run_cucumber
    elsif @opts[:fitnesse]
        run_fitnesse
    elsif @opts[:php]
        run_php
    elsif @opts[:behat]
        run_behat
    elsif @opts[:ruby]
        run_ruby
    end

end

#opts_validateObject



14
15
16
17
18
19
20
21
22
# File 'lib/routes/test.rb', line 14

def opts_validate

    App::UtilsRoutes::max_one_flag(@opts)

    if App::UtilsRoutes::flags_set(@opts) == 0
        @opts[:php] == true
    end

end

#run_behatObject



60
61
62
63
64
65
# File 'lib/routes/test.rb', line 60

def run_behat

    App::Terminal::info("Running #{App::Terminal::format_action('Behat Tests')} on VM \xe2\x80\x94 #{App::Terminal::format_highlight("#{App::Config.param(ConfigUnique::VM_IP)}")}")
    App::SSH::run_script_on_remote('vm', 'run-behat-tests.sh', $args)

end

#run_cucumberObject



40
41
42
43
44
45
# File 'lib/routes/test.rb', line 40

def run_cucumber

    App::Terminal::info("Running #{App::Terminal::format_action('Cucumber Tests')} on VM \xe2\x80\x94 #{App::Terminal::format_highlight("#{App::Config.param(ConfigUnique::VM_IP)}")}")
    App::Terminal::info('Not yet implemented')

end

#run_fitnesseObject



47
48
49
50
51
# File 'lib/routes/test.rb', line 47

def run_fitnesse

    App::Terminal::info('Not yet implemented')

end

#run_phpObject



53
54
55
56
57
58
# File 'lib/routes/test.rb', line 53

def run_php

    App::Terminal::info("Running #{App::Terminal::format_action('PHPUnit Tests')} on VM \xe2\x80\x94 #{App::Terminal::format_highlight("#{App::Config.param(ConfigUnique::VM_IP)}")}")
    App::SSH::run_script_on_remote('vm', 'run-phpunit-tests.sh', @args)

end

#run_rubyObject



67
68
69
70
71
# File 'lib/routes/test.rb', line 67

def run_ruby

    App::Terminal::info('Not yet implemented')

end