schemacop 3.0.8 → 3.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,10 @@ require 'test_helper'
3
3
  module Schemacop
4
4
  module V3
5
5
  class SymbolNodeTest < V3Test
6
- EXP_INVALID_TYPE = 'Invalid type, expected "Symbol".'.freeze
6
+ def self.invalid_type_error(type)
7
+ type = type.class unless type.class == Class
8
+ "Invalid type, got type \"#{type}\", expected \"Symbol\"."
9
+ end
7
10
 
8
11
  def test_basic
9
12
  schema :symbol
@@ -11,10 +14,10 @@ module Schemacop
11
14
  assert_validation :foo
12
15
  assert_validation :'n0238n)Q(hqr3hrw3'
13
16
  assert_validation 42 do
14
- error '/', EXP_INVALID_TYPE
17
+ error '/', SymbolNodeTest.invalid_type_error(Integer)
15
18
  end
16
19
  assert_validation '42' do
17
- error '/', EXP_INVALID_TYPE
20
+ error '/', SymbolNodeTest.invalid_type_error(String)
18
21
  end
19
22
  assert_json({})
20
23
  end
@@ -56,13 +59,13 @@ module Schemacop
56
59
  # Even we put those types in the enum, they need to fail the validations,
57
60
  # as they are not symbols
58
61
  assert_validation('foo') do
59
- error '/', 'Invalid type, expected "Symbol".'
62
+ error '/', SymbolNodeTest.invalid_type_error(String)
60
63
  end
61
64
  assert_validation(1) do
62
- error '/', 'Invalid type, expected "Symbol".'
65
+ error '/', SymbolNodeTest.invalid_type_error(Integer)
63
66
  end
64
67
  assert_validation({ qux: 42 }) do
65
- error '/', 'Invalid type, expected "Symbol".'
68
+ error '/', SymbolNodeTest.invalid_type_error(Hash)
66
69
  end
67
70
 
68
71
  # These need to fail validation, as they are not in the enum list
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schemacop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-23 00:00:00.000000000 Z
11
+ date: 2021-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -170,10 +170,10 @@ executables: []
170
170
  extensions: []
171
171
  extra_rdoc_files: []
172
172
  files:
173
+ - ".github/workflows/ruby.yml"
173
174
  - ".gitignore"
174
175
  - ".releaser_config"
175
176
  - ".rubocop.yml"
176
- - ".travis.yml"
177
177
  - ".yardopts"
178
178
  - CHANGELOG.md
179
179
  - Gemfile
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.1.2
295
+ rubygems_version: 3.0.3
296
296
  signing_key:
297
297
  specification_version: 4
298
298
  summary: Schemacop validates ruby structures consisting of nested hashes and arrays
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.2
4
- - 2.7.1
5
- - 3.0.0
6
- script:
7
- - bundle install
8
- - bundle exec rake test
9
- - bundle exec rubocop