forked from saasbook/rag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrade5
executable file
·39 lines (31 loc) · 1.09 KB
/
grade5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/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 admin_user admin_password 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!=4 || ARGV[0] =~ /^-?-h/)
g = AutoGrader.create('5',
'HW5Grader',
ARGV[0],
{
:admin_user => ARGV[1],
:admin_pass => ARGV[2],
:spec => ARGV[3]
})
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"