Class: Mumukit::Metatest::Framework

Inherits:
Object
  • Object
show all
Defined in:
lib/mumukit/metatest/framework.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Framework

Returns a new instance of Framework.



3
4
5
6
# File 'lib/mumukit/metatest/framework.rb', line 3

def initialize(options={})
  @runner = options[:runner]
  @checker = options[:checker]
end

Instance Method Details

#example(compilation, example) ⇒ Object



16
17
18
# File 'lib/mumukit/metatest/framework.rb', line 16

def example(compilation, example)
  @checker.check(@runner.run(compilation, example), example)
end

#test(compilation, examples) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/mumukit/metatest/framework.rb', line 8

def test(compilation, examples)
  [examples.map { |it| example(compilation, it) }]
rescue Aborted => e
  [e.message, :aborted]
rescue Errored => e
  [e.message, :errored]
end