Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 33 lines (24 sloc) 884 Bytes
#!/usr/bin/env ruby
# -*- mode: ruby -*-
# An example use of the Ruby autograder
require './lib/auto_grader.rb'
require 'ruby-debug'
def grade(file,spec)
end
def usage
STDERR.puts <<EndOfHelp
Usage: #{$0} submission_uri specfile.rb
Creates an autograder of the HerokuRspecGrader subclass (which evaluates
student code based solely on RSpec output) and grades the Heroku submission URI
with it.
EndOfHelp
exit
end
usage() if (ARGV.length!=2 || ARGV[0] =~ /^-?-h/)
g = AutoGrader.create('1', 'HerokuRspecGrader', ARGV[0], :spec => ARGV[1])
g.grade!
puts "Score out of 100: #{g.normalized_score(100)}\n"
puts "---BEGIN rspec comments---\n#{'-'*80}\n#{g.comments}\n#{'-'*80}\n---END rspec comments---"
# PFX = 'spec/fixtures'
# grade "#{PFX}/correct_example.rb", "#{PFX}/correct_example.spec.rb"
# grade "#{PFX}/example_with_syntax_error.rb", "#{PFX}/correct_example.spec.rb"
Something went wrong with that request. Please try again.