Skip to content

Commit

Permalink
Merge pull request #17 from dskecse/fix-input-and-reference-comparison
Browse files Browse the repository at this point in the history
Fix input and reference comparison
  • Loading branch information
saslani committed Feb 7, 2017
2 parents 5352d57 + 0ef7d0d commit 00909bf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ruby_drills/drill.rb
Expand Up @@ -53,11 +53,10 @@ def done?(input)
def check_answer(input)
begin
Pry.run_command input, :context => @context, :output => answer = StringIO.new
Pry.run_command reference, :context => @context, :output => exp = StringIO.new

puts answer.string

return fail(input) if answer.string != exp.string
return fail(input) if eval(input, @context) != eval(reference, @context)
return false if !comparable_answer?(input)
win(input)
rescue SyntaxError => ex
Expand Down

0 comments on commit 00909bf

Please sign in to comment.