Permalink
Browse files

changed validator: include file-path in failing test, ruby 1.8.7 compat

  • Loading branch information...
1 parent 10cb7e6 commit 0a6acedf0e5e964363dae0dc4565c03f629bc79e @schorsch schorsch committed Jun 13, 2011
Showing with 4 additions and 2 deletions.
  1. +2 −0 Gemfile
  2. +2 −2 validate_all.rb
View
@@ -1,2 +1,4 @@
source :rubygems
+gem 'json'
gem 'json-schema'
+gem 'minitest'
View
@@ -13,9 +13,9 @@
begin
question = File.open(file) { |f| JSON.parse(f.read) }['question']
- JSON::Validator.validate!(schema, question, version: :draft3 )
+ JSON::Validator.validate!(schema, question, :version=> :draft3 )
rescue JSON::Schema::ValidationError => schema_error
- assertion = false, schema_error.message + "\n[#{question['created_by']}, please fix this and send another pull request!]"
+ assertion = false, schema_error.message + "\nIn: #{file}\n[#{question['created_by']}, please fix this and send another pull request!]"
rescue JSON::ParserError => parser_error
assertion = false, parser_error.message
else

0 comments on commit 0a6aced

Please sign in to comment.