Class: Judges::Test

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

Overview

Test.

Author

Yegor Bugayenko (yegor256@gmail.com)

Copyright

Copyright © 2024 Yegor Bugayenko

License

MIT

Instance Method Summary collapse

Constructor Details

#initialize(loog) ⇒ Test

Returns a new instance of Test.



33
34
35
# File 'lib/judges/test.rb', line 33

def initialize(loog)
  @loog = loog
end

Instance Method Details

#run(_opts, args) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/judges/test.rb', line 37

def run(_opts, args)
  raise 'Exactly one argument required' unless args.size == 1
  dir = args[0]
  done = Judges::Packs.new(dir).each_with_index do |p, i|
    p.tests.each do |t|
      test_one(p, t)
    end
    @loog.info("Pack ##{i} found in #{p.dir}")
  end
  @loog.info("#{done} judges tested")
end