json-spec 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/json-spec.gemspec +1 -1
- data/lib/cabeza-de-termo/json-spec/expectations-library/definition-builders/expectation-builders/expectation-definition.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/expectations-library/definition-builders/modifier-builders/modifier-definition.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/expectations-library/initializers/library-initializer.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/expectations/abstract-expectation.rb +6 -6
- data/lib/cabeza-de-termo/json-spec/expectations/runner/abstract-expectations-runner.rb +4 -4
- data/lib/cabeza-de-termo/json-spec/expressions/json-spec.rb +1 -0
- data/lib/cabeza-de-termo/json-spec/instantiators/abstract-instantiator.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/instantiators/composite-instantiator.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/message-formatters/message-formatter.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/modifiers/expression-modifier.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/version.rb +1 -1
- data/lib/cabeza-de-termo/json-spec/walkers/expression-walker.rb +12 -12
- data/lib/cabeza-de-termo/json-spec/walkers/json-expectations-runner.rb +6 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7c5b0ef1b9b89e5fc9b8a67cea2b1b73eb6a82e
|
4
|
+
data.tar.gz: 0a6e0a666f87d2d67f39d9670784ed97cca370d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fd7aab56ea788ef106e904274ce45118418981f7dfb132823ff11f3f1dd36f57dec2724a7f1bdfd9fbae7c4f2ec6d9a600dc445db8ac831a7b21011321f98d2
|
7
|
+
data.tar.gz: f29dde5f94bdd8e5e9b167ddb91074cb8f3ab3c54e00812e6696b2ca37d4ee8faf11b284ef93a5e6ae8b4581d96e0065c171ba7d7d6f47575bf71e93b08ac137
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ A framework to declare expectations and verify that a json object satisfies thos
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem 'json-spec'
|
16
|
+
gem 'json-spec', '~> 0.1'
|
17
17
|
```
|
18
18
|
|
19
19
|
And then execute:
|
@@ -949,6 +949,7 @@ and that's it. You have a fully prepared, ready to use development environment.
|
|
949
949
|
|
950
950
|
# Running the tests
|
951
951
|
|
952
|
+
* `bundle install`
|
952
953
|
* `rake test`
|
953
954
|
|
954
955
|
## Contributing
|
data/json-spec.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.required_ruby_version = '>= 2.0'
|
23
23
|
|
24
|
-
spec.add_dependency "cdt-utilities", '~> 0.
|
24
|
+
spec.add_dependency "cdt-utilities", '~> 0.2'
|
25
25
|
spec.add_dependency "validates_email_format_of", "~> 1.6"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.10"
|
@@ -4,35 +4,35 @@ module CabezaDeTermo
|
|
4
4
|
# Accessing
|
5
5
|
|
6
6
|
def set_json_spec(json_spec)
|
7
|
-
|
7
|
+
CdT.subclass_responsibility
|
8
8
|
end
|
9
9
|
|
10
10
|
def set_expectation_method(expectation_method)
|
11
|
-
|
11
|
+
CdT.subclass_responsibility
|
12
12
|
end
|
13
13
|
|
14
14
|
# Message format
|
15
15
|
|
16
16
|
def failed_message_on(value_holder)
|
17
|
-
|
17
|
+
CdT.subclass_responsibility
|
18
18
|
end
|
19
19
|
|
20
20
|
# Evaluating
|
21
21
|
|
22
22
|
def is_satisfied_by?(value_holder)
|
23
|
-
|
23
|
+
CdT.subclass_responsibility
|
24
24
|
end
|
25
25
|
|
26
26
|
# Walking
|
27
27
|
|
28
28
|
def accept_walker(expression_walker)
|
29
|
-
|
29
|
+
CdT.subclass_responsibility
|
30
30
|
end
|
31
31
|
|
32
32
|
# Explaining
|
33
33
|
|
34
34
|
def explain()
|
35
|
-
|
35
|
+
CdT.subclass_responsibility
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -4,23 +4,23 @@ module CabezaDeTermo
|
|
4
4
|
# Adding
|
5
5
|
|
6
6
|
def add(expectation)
|
7
|
-
|
7
|
+
CdT.subclass_responsibility
|
8
8
|
end
|
9
9
|
|
10
10
|
# Walking
|
11
11
|
|
12
12
|
def accept_walker(expression_walker)
|
13
|
-
|
13
|
+
CdT.subclass_responsibility
|
14
14
|
end
|
15
15
|
|
16
16
|
def accept_walker_with_value_holder(expression_walker, value_holder)
|
17
|
-
|
17
|
+
CdT.subclass_responsibility
|
18
18
|
end
|
19
19
|
|
20
20
|
# Explaining
|
21
21
|
|
22
22
|
def explain_with(expression_walker)
|
23
|
-
|
23
|
+
CdT.subclass_responsibility
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -6,51 +6,51 @@ module CabezaDeTermo
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def walk_json_spec(json_spec)
|
9
|
-
|
9
|
+
CdT.subclass_responsibility
|
10
10
|
end
|
11
11
|
|
12
12
|
def walk_json_object(json_object)
|
13
|
-
|
13
|
+
CdT.subclass_responsibility
|
14
14
|
end
|
15
15
|
|
16
16
|
def walk_json_each_field(json_each_field)
|
17
|
-
|
17
|
+
CdT.subclass_responsibility
|
18
18
|
end
|
19
19
|
|
20
20
|
def walk_json_field_name(json_field_name)
|
21
|
-
|
21
|
+
CdT.subclass_responsibility
|
22
22
|
end
|
23
23
|
|
24
24
|
def walk_json_list(json_list)
|
25
|
-
|
25
|
+
CdT.subclass_responsibility
|
26
26
|
end
|
27
27
|
|
28
28
|
def walk_json_each(json_each)
|
29
|
-
|
29
|
+
CdT.subclass_responsibility
|
30
30
|
end
|
31
31
|
|
32
32
|
def walk_json_field(json_field)
|
33
|
-
|
33
|
+
CdT.subclass_responsibility
|
34
34
|
end
|
35
35
|
|
36
36
|
def walk_json_scalar(json_scalar)
|
37
|
-
|
37
|
+
CdT.subclass_responsibility
|
38
38
|
end
|
39
39
|
|
40
40
|
def walk_json_any_of(json_any_of)
|
41
|
-
|
41
|
+
CdT.subclass_responsibility
|
42
42
|
end
|
43
43
|
|
44
44
|
def walk_json_anything(json_anything)
|
45
|
-
|
45
|
+
CdT.subclass_responsibility
|
46
46
|
end
|
47
47
|
|
48
48
|
def walk_expectation_runner(expectation_runner)
|
49
|
-
|
49
|
+
CdT.subclass_responsibility
|
50
50
|
end
|
51
51
|
|
52
52
|
def walk_expectation(expectation)
|
53
|
-
|
53
|
+
CdT.subclass_responsibility
|
54
54
|
end
|
55
55
|
|
56
56
|
# Error handling
|
@@ -16,7 +16,7 @@ module CabezaDeTermo
|
|
16
16
|
# @return boolean
|
17
17
|
#
|
18
18
|
def no_errors?()
|
19
|
-
|
19
|
+
CdT.subclass_responsibility
|
20
20
|
end
|
21
21
|
|
22
22
|
def has_errors?()
|
@@ -26,25 +26,25 @@ module CabezaDeTermo
|
|
26
26
|
|
27
27
|
# Hooks
|
28
28
|
def on_unwalked_field(field_name, value_holder)
|
29
|
-
|
29
|
+
CdT.subclass_responsibility
|
30
30
|
end
|
31
31
|
|
32
32
|
def on_json_any_of_was_satisfied_with_runner(expectations_runner)
|
33
|
-
|
33
|
+
CdT.subclass_responsibility
|
34
34
|
end
|
35
35
|
|
36
36
|
def on_json_any_of_failed_with_all_runners(expectations_runners)
|
37
|
-
|
37
|
+
CdT.subclass_responsibility
|
38
38
|
end
|
39
39
|
|
40
40
|
def on_walked_expectation(expectation, value_holder, was_satisfied)
|
41
|
-
|
41
|
+
CdT.subclass_responsibility
|
42
42
|
end
|
43
43
|
|
44
44
|
# Instance creation
|
45
45
|
|
46
46
|
def new_json_expectations_runner()
|
47
|
-
|
47
|
+
CdT.subclass_responsibility
|
48
48
|
end
|
49
49
|
|
50
50
|
# Walking expressions
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Rubi
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: validates_email_format_of
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
240
|
version: '0'
|
241
241
|
requirements: []
|
242
242
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.4.
|
243
|
+
rubygems_version: 2.4.6
|
244
244
|
signing_key:
|
245
245
|
specification_version: 4
|
246
246
|
summary: A framework to declare expectations on a json format and validate that a
|