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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d950cd2da7210e0edb2f3ae51e57a2649e9d913b
4
- data.tar.gz: 65bbc08cf21a7d6d1f075311981061cc441cf4ef
3
+ metadata.gz: d7c5b0ef1b9b89e5fc9b8a67cea2b1b73eb6a82e
4
+ data.tar.gz: 0a6e0a666f87d2d67f39d9670784ed97cca370d2
5
5
  SHA512:
6
- metadata.gz: 82bec3c17230b4fc2e14f4c7b3ded8b4c52e985b87ae3ca15336a10b28af8b7f1fa73a39093b476fa94eaf89fa0439d7f6d557b228834c89b33e41aa10185795
7
- data.tar.gz: cd0f955f2247a27ac9db51d2583c6217a5c045057955d1b54d3cc9ea8768add7158d20b6692bfd195eb4d54bf9a48a9f2be8019a290754408270fa7586f2ad50
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
@@ -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.1'
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"
@@ -6,7 +6,7 @@ module CabezaDeTermo
6
6
  end
7
7
 
8
8
  def modifier_instantiator
9
- raise 'Subclass responsibility'
9
+ CdT.subclass_responsibility
10
10
  end
11
11
 
12
12
  protected
@@ -6,7 +6,7 @@ module CabezaDeTermo
6
6
  end
7
7
 
8
8
  def modifier_instantiator
9
- raise 'Subclass responsibility'
9
+ CdT.subclass_responsibility
10
10
  end
11
11
  end
12
12
  end
@@ -2,7 +2,7 @@ module CabezaDeTermo
2
2
  module JsonSpec
3
3
  class LibraryInitializer
4
4
  def new_library()
5
- raise 'Subclass responsibility'
5
+ CdT.subclass_responsibility
6
6
  end
7
7
  end
8
8
  end
@@ -4,35 +4,35 @@ module CabezaDeTermo
4
4
  # Accessing
5
5
 
6
6
  def set_json_spec(json_spec)
7
- raise 'Subclass responsibility'
7
+ CdT.subclass_responsibility
8
8
  end
9
9
 
10
10
  def set_expectation_method(expectation_method)
11
- raise 'Subclass responsibility'
11
+ CdT.subclass_responsibility
12
12
  end
13
13
 
14
14
  # Message format
15
15
 
16
16
  def failed_message_on(value_holder)
17
- raise 'Subclass responsibility'
17
+ CdT.subclass_responsibility
18
18
  end
19
19
 
20
20
  # Evaluating
21
21
 
22
22
  def is_satisfied_by?(value_holder)
23
- raise 'Subclass responsibility'
23
+ CdT.subclass_responsibility
24
24
  end
25
25
 
26
26
  # Walking
27
27
 
28
28
  def accept_walker(expression_walker)
29
- raise 'Subclass responsibility'
29
+ CdT.subclass_responsibility
30
30
  end
31
31
 
32
32
  # Explaining
33
33
 
34
34
  def explain()
35
- raise 'Subclass responsibility'
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
- raise 'Subclass responsibility'
7
+ CdT.subclass_responsibility
8
8
  end
9
9
 
10
10
  # Walking
11
11
 
12
12
  def accept_walker(expression_walker)
13
- raise 'Subclass responsibility'
13
+ CdT.subclass_responsibility
14
14
  end
15
15
 
16
16
  def accept_walker_with_value_holder(expression_walker, value_holder)
17
- raise 'Subclass responsibility'
17
+ CdT.subclass_responsibility
18
18
  end
19
19
 
20
20
  # Explaining
21
21
 
22
22
  def explain_with(expression_walker)
23
- raise 'Subclass responsibility'
23
+ CdT.subclass_responsibility
24
24
  end
25
25
  end
26
26
  end
@@ -1,5 +1,6 @@
1
1
  require 'json'
2
2
  require 'cdt/utilities/bind'
3
+ require 'cdt/utilities/subclass-responsibility'
3
4
  require "cabeza-de-termo/json-spec/expectations-library/expectations-library"
4
5
  require "cabeza-de-termo/json-spec/walkers/validator/json-validator"
5
6
 
@@ -2,7 +2,7 @@ module CabezaDeTermo
2
2
  module JsonSpec
3
3
  class AbstractInstantiator
4
4
  def new(*args)
5
- raise 'Subclass responsibility'
5
+ CdT.subclass_responsibility
6
6
  end
7
7
  end
8
8
  end
@@ -38,7 +38,7 @@ module CabezaDeTermo
38
38
  end
39
39
 
40
40
  def new_composite_expectation()
41
- raise 'Subclass responsibility'
41
+ CdT.subclass_responsibility
42
42
  end
43
43
  end
44
44
  end
@@ -2,7 +2,7 @@ module CabezaDeTermo
2
2
  module JsonSpec
3
3
  class MessageFormatter
4
4
  def message_on(expectation, value_holder, *params)
5
- raise 'Subclass responsibility'
5
+ CdT.subclass_responsibility
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module CabezaDeTermo
2
2
  module JsonSpec
3
3
  class ExpressionModifier
4
4
  def run_on(expression)
5
- raise 'Subclass responsibility'
5
+ CdT.subclass_responsibility
6
6
  end
7
7
  end
8
8
  end
@@ -1,5 +1,5 @@
1
1
  module CabezaDeTermo
2
2
  module JsonSpec
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -6,51 +6,51 @@ module CabezaDeTermo
6
6
  end
7
7
 
8
8
  def walk_json_spec(json_spec)
9
- raise 'Subclass responsibility'
9
+ CdT.subclass_responsibility
10
10
  end
11
11
 
12
12
  def walk_json_object(json_object)
13
- raise 'Subclass responsibility'
13
+ CdT.subclass_responsibility
14
14
  end
15
15
 
16
16
  def walk_json_each_field(json_each_field)
17
- raise 'Subclass responsibility'
17
+ CdT.subclass_responsibility
18
18
  end
19
19
 
20
20
  def walk_json_field_name(json_field_name)
21
- raise 'Subclass responsibility'
21
+ CdT.subclass_responsibility
22
22
  end
23
23
 
24
24
  def walk_json_list(json_list)
25
- raise 'Subclass responsibility'
25
+ CdT.subclass_responsibility
26
26
  end
27
27
 
28
28
  def walk_json_each(json_each)
29
- raise 'Subclass responsibility'
29
+ CdT.subclass_responsibility
30
30
  end
31
31
 
32
32
  def walk_json_field(json_field)
33
- raise 'Subclass responsibility'
33
+ CdT.subclass_responsibility
34
34
  end
35
35
 
36
36
  def walk_json_scalar(json_scalar)
37
- raise 'Subclass responsibility'
37
+ CdT.subclass_responsibility
38
38
  end
39
39
 
40
40
  def walk_json_any_of(json_any_of)
41
- raise 'Subclass responsibility'
41
+ CdT.subclass_responsibility
42
42
  end
43
43
 
44
44
  def walk_json_anything(json_anything)
45
- raise 'Subclass responsibility'
45
+ CdT.subclass_responsibility
46
46
  end
47
47
 
48
48
  def walk_expectation_runner(expectation_runner)
49
- raise 'Subclass responsibility'
49
+ CdT.subclass_responsibility
50
50
  end
51
51
 
52
52
  def walk_expectation(expectation)
53
- raise 'Subclass responsibility'
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
- raise 'Subclass responsibility'
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
- raise 'Subclass responsibility'
29
+ CdT.subclass_responsibility
30
30
  end
31
31
 
32
32
  def on_json_any_of_was_satisfied_with_runner(expectations_runner)
33
- raise 'Subclass responsibility'
33
+ CdT.subclass_responsibility
34
34
  end
35
35
 
36
36
  def on_json_any_of_failed_with_all_runners(expectations_runners)
37
- raise 'Subclass responsibility'
37
+ CdT.subclass_responsibility
38
38
  end
39
39
 
40
40
  def on_walked_expectation(expectation, value_holder, was_satisfied)
41
- raise 'Subclass responsibility'
41
+ CdT.subclass_responsibility
42
42
  end
43
43
 
44
44
  # Instance creation
45
45
 
46
46
  def new_json_expectations_runner()
47
- raise 'Subclass responsibility'
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.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.1'
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.1'
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.5.1
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