Class: Jtest::Commands::Test

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/jtest/commands/test.rb

Instance Method Summary collapse

Instance Method Details

#perform_testsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/jtest/commands/test.rb', line 15

def perform_tests
  @counter = { :failed => 0, :missing => 0, :wrong => 0, :passed => 0 }

  @problems.each do |problem|
    next unless File.directory?(problem.dirname)
    
    say_status :testing, "Running tests on #{problem.dirname}...", :blue
    Dir.chdir(problem.dirname) { perform_test(problem.dirname) }
  end
  
  colors = { :failed => :magenta, :missing => :yellow, :wrong => :red, :passed => :green }
  summary(colors)
end

#select_problem_dirsObject



11
12
13
# File 'lib/jtest/commands/test.rb', line 11

def select_problem_dirs
  @problems = Problem.select(ids)
end