Skip to content

Commit

Permalink
Merge pull request #157 from iainbeeston/test_optional_gems
Browse files Browse the repository at this point in the history
Add yajl, multi_json and uuidtools to travis
  • Loading branch information
hoxworth committed Oct 28, 2014
2 parents 99c3c6f + 7f5ed1c commit 3d2632d
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
language: ruby
language: "ruby"
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.1"
- "2.1.2"
- "1.9"
- "2.0"
- "2.1"
- "jruby"
- "rbx"
# uncomment this line if your project needs to run something other than `rake`:
# script: bundle exec rspec spec
matrix:
include:
- rvm: "2.1"
gemfile: "gemfiles/Gemfile.multi_json.x"
- rvm: "2.1"
gemfile: "gemfiles/Gemfile.yajl-ruby.x"
- rvm: "2.1"
gemfile: "gemfiles/Gemfile.uuidtools.x"
9 changes: 9 additions & 0 deletions gemfiles/Gemfile.multi_json.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source "https://rubygems.org"

gemspec :path => "../"

gem "multi_json"

group :development do
gem "rake"
end
9 changes: 9 additions & 0 deletions gemfiles/Gemfile.uuidtools.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source "https://rubygems.org"

gemspec :path => "../"

gem "uuidtools"

group :development do
gem "rake"
end
9 changes: 9 additions & 0 deletions gemfiles/Gemfile.yajl-ruby.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source "https://rubygems.org"

gemspec :path => "../"

gem "yajl-ruby"

group :development do
gem "rake"
end
2 changes: 1 addition & 1 deletion lib/json-schema/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def parse(s)
when 'yajl'
json = StringIO.new(s)
parser = Yajl::Parser.new
parser.parse(json)
parser.parse(json) or raise JSON::Schema::JsonParseError.new("The JSON could not be parsed by yajl")
else
raise JSON::Schema::JsonParseError.new("No supported JSON parsers found. The following parsers are suported:\n * yajl-ruby\n * json")
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_common_test_suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CommonTestSuiteTest < Test::Unit::TestCase
v = nil

test["tests"].each do |t|
err_id = "#{rel_file}, '#{base_description}'/'#{t['description']}'"
err_id = "#{rel_file}: #{base_description}/#{t['description']}"

define_method("test_#{err_id}") do
skip "Known incompatibility with common test suite" if IGNORED_TESTS.include?(rel_file)
Expand All @@ -41,7 +41,7 @@ class CommonTestSuiteTest < Test::Unit::TestCase
)
end

assert v.empty? == t["valid"], "Common test suite case failed: #{err_id}\n#{v}"
assert_equal t["valid"], v.empty?, "Common test suite case failed: #{err_id}\n#{v}"
end
end
end
Expand Down

0 comments on commit 3d2632d

Please sign in to comment.