Sha256: bcf25620ebc832ad261f2ed468175fce4736977ec1b6c200ed2f1e3e67e36e48
Contents?: true
Size: 666 Bytes
Versions: 1
Compression:
Stored size: 666 Bytes
Contents
class Mumukit::Assistant::Rule::TheseTestsFailed < Mumukit::Assistant::Rule::SubmissionFailed def initialize(message, tests) raise 'missing tests' if tests.blank? super(message) @tests = tests end def matches?(submission) super && matches_failing_tests?(submission) end def matches_failing_tests?(submission) @tests.all? do |it| includes_failing_test? it, submission end end def includes_failing_test?(title, submission) failed_tests(submission).map { |it| it[:title] }.include?(title) end def failed_tests(submission) @failed_tests ||= submission.test_results.select { |it| it[:status].failed? } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mumukit-assistant-0.2.0 | lib/mumukit/assistant/rule/these_tests_failed.rb |