forked from saasbook/rag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrade_heroku
More file actions
executable file
·32 lines (24 loc) · 884 Bytes
/
grade_heroku
File metadata and controls
executable file
·32 lines (24 loc) · 884 Bytes
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
#!/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"