Skip to content

Commit

Permalink
Enable coveralls + simplecov coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
pd committed Oct 27, 2014
1 parent 8daf3de commit 80e8717
Show file tree
Hide file tree
Showing 25 changed files with 38 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pkg
/Gemfile.lock
.bundle
.idea
/coverage
10 changes: 10 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
add_filter '/test/'
end
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ gemspec

group :development do
gem "rake"
gem "coveralls", require: false
end
3 changes: 1 addition & 2 deletions test/test_all_of_ref_schema.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class AllOfRefSchemaTest < Test::Unit::TestCase
def test_all_of_ref_schema_fails
Expand Down
3 changes: 1 addition & 2 deletions test/test_any_of_ref_schema.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class AnyOfRefSchemaTest < Test::Unit::TestCase
def test_any_of_ref_schema
Expand Down
3 changes: 1 addition & 2 deletions test/test_bad_schema_ref.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'test/unit'
require_relative 'test_helper'
require 'socket'
require File.dirname(__FILE__) + '/../lib/json-schema'

class BadSchemaRefTest < Test::Unit::TestCase

Expand Down
3 changes: 1 addition & 2 deletions test/test_common_test_suite.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.expand_path('../../lib/json-schema', __FILE__)
require_relative 'test_helper'

class CommonTestSuiteTest < Test::Unit::TestCase
TEST_DIR = File.expand_path('../test-suite/tests', __FILE__)
Expand Down
3 changes: 1 addition & 2 deletions test/test_custom_format.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding: utf-8
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONSchemaCustomFormatTest < Test::Unit::TestCase
def setup
Expand Down
5 changes: 2 additions & 3 deletions test/test_extended_schema.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class BitwiseAndAttribute < JSON::Schema::Attribute
def self.validate(current_schema, data, fragments, processor, validator, options = {})
Expand Down Expand Up @@ -65,4 +64,4 @@ def test_schema_from_file
data = {"a" => 1, "b" => 5}
assert(!JSON::Validator.validate(schema,data))
end
end
end
3 changes: 1 addition & 2 deletions test/test_extends_and_additionalProperties.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class ExtendsNestedTest < Test::Unit::TestCase

Expand Down
3 changes: 1 addition & 2 deletions test/test_files_v3.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONSchemaTest < Test::Unit::TestCase

Expand Down
3 changes: 1 addition & 2 deletions test/test_fragment_resolution.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class FragmentResolution < Test::Unit::TestCase
def test_fragment_resolution
Expand Down
3 changes: 1 addition & 2 deletions test/test_fragment_validation_with_ref.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require File.expand_path('../test_helper', __FILE__)
require 'json-schema'
require_relative 'test_helper'

class FragmentValidationWithRef < Test::Unit::TestCase
def whole_schema
Expand Down
3 changes: 1 addition & 2 deletions test/test_full_validation.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONFullValidation < Test::Unit::TestCase

Expand Down
3 changes: 3 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
require 'simplecov' unless ENV['COVERAGE'] == 'false'
require 'test/unit'

$:.unshift(File.expand_path('../../lib', __FILE__))
require 'json-schema'
3 changes: 1 addition & 2 deletions test/test_jsonschema_draft1.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONSchemaDraft1Test < Test::Unit::TestCase
def test_types
Expand Down
3 changes: 1 addition & 2 deletions test/test_jsonschema_draft2.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONSchemaDraft2Test < Test::Unit::TestCase
def test_types
Expand Down
3 changes: 1 addition & 2 deletions test/test_jsonschema_draft3.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding: utf-8
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONSchemaDraft3Test < Test::Unit::TestCase
def test_types
Expand Down
3 changes: 1 addition & 2 deletions test/test_jsonschema_draft4.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# encoding: utf-8
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONSchemaDraft4Test < Test::Unit::TestCase
def test_types
Expand Down
5 changes: 2 additions & 3 deletions test/test_list_option.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class ListOptionTest < Test::Unit::TestCase
def test_list_option_reusing_schemas
Expand All @@ -19,4 +18,4 @@ def test_list_option_reusing_schemas
data = [{"a" => 1}]
assert(JSON::Validator.validate(uri.to_s, data, :list => true))
end
end
end
4 changes: 1 addition & 3 deletions test/test_minitems.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class MinItemsTest < Test::Unit::TestCase
def test_minitems_nils
Expand All @@ -8,7 +7,6 @@ def test_minitems_nils
"minItems" => 1,
"items" => { "type" => "object" }
}
data = [nil]

errors = JSON::Validator.fully_validate(schema, [nil])
assert_equal(errors.length, 1)
Expand Down
3 changes: 1 addition & 2 deletions test/test_one_of.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class OneOfTest < Test::Unit::TestCase
def test_one_of_links_schema
Expand Down
3 changes: 1 addition & 2 deletions test/test_ruby_schema.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class RubySchemaTest < Test::Unit::TestCase
def test_string_keys
Expand Down
3 changes: 1 addition & 2 deletions test/test_schema_type_attribute.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class TestSchemaTypeAttribute < Test::Unit::TestCase
def test_type_of_data
Expand Down
3 changes: 1 addition & 2 deletions test/test_schema_validation.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../lib/json-schema'
require_relative 'test_helper'

class JSONSchemaValidation < Test::Unit::TestCase
def valid_schema_v3
Expand Down

0 comments on commit 80e8717

Please sign in to comment.