Class: ErpDevSvcs::Commands::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/erp_dev_svcs/commands/test.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTest

Returns a new instance of Test.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/erp_dev_svcs/commands/test.rb', line 12

def initialize
  options = {:gems => nil}

  opt_parser = OptionParser.new do |opt|
    opt.banner = "Usage: compass_ae-dev test [OPTIONS]"

    opt.on("-g", "--gems [GEMLIST]", Array,
           "List of engines to test;"\
           "defaults to all") {|gem| options[:gems] = gem}

    opt.on_tail("-h", "--help", "Show this message") do
      puts opt
      exit
    end
  end

  opt_parser.parse!
  ErpDevSvcs::Commands::Helper.exec_in_engines(options[:gems]) do |engine_name|
    puts "\nRunning #{engine_name}'s test suite...  \n"
    result = %x[bundle exec rspec --tty --color spec]
    puts result
  end
end

Class Method Details

.executeObject



8
9
10
# File 'lib/erp_dev_svcs/commands/test.rb', line 8

def self.execute
  new()
end