Project

examiner

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Grade a student's exercise solution using rake and minitest
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.5
>= 0
 Project Readme

Build Status Gem Version

Examiner

Grade a student's exercise solution, assuming:

  • The exercise uses minitest to be checked
  • There is a Rakefile in the exercise folder

Installation

Add this line to your application's Gemfile:

gem 'examiner'

And then execute:

$ bundle

Usage

You can quickly grade a student's exercise solution with the following code.

exercise_directory = "/path/to/student_exercise_with_rakefile"

runner = Examiner::RakeRunner.new
begin
  runner.run exercise_directory
  puts "Results: #{runner.tests - runner.failures}/#{runner.tests}"
rescue Examiner::RakefileMissingError => e
  puts "Folder does not have any Rakefile"
rescue Examiner::MissingDefaultRakeTaskError => e
  puts "Could not launch tests with 'rake'"
end

# You can display stdout and stderr
puts runner.stdout_lines.join
puts runner.stderr_lines.join