shokkenki-provider 0.0.4 → 0.0.5
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 +7 -0
- data/lib/shokkenki/provider/model/fixture_requirement.rb +1 -4
- data/lib/shokkenki/provider/model/ticket.rb +1 -1
- data/lib/shokkenki/provider/rspec/rspec_configuration.rb +7 -0
- data/lib/shokkenki/provider/rspec/term/json_paths_term.rb +4 -2
- data/lib/shokkenki/provider/rspec.rb +3 -1
- data/lib/shokkenki/provider/ticket_reader.rb +6 -2
- data/lib/shokkenki/provider/version.rb +1 -1
- metadata +47 -53
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5cc65f523125f14555e350faf062b59d15fb840b
|
4
|
+
data.tar.gz: 7d0ecd02eeb3af224d4de57b38ad37e079acd7b7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3bf25cbc160477bbe6aff2b2c6dfd21dc033657560c7249994c12467b109e20407da0411d525215856e0354e46ab54eaff6432c931147bdaea8d1bb27890d55a
|
7
|
+
data.tar.gz: 88b9df463b4795bfba64749c158a88122450bd514433672d03e9b87e92e2f8d77fce9f4a79fc02eeb768917fa0356531065709154425664100ef148eabcbfe41
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'active_support/core_ext/hash/keys'
|
2
|
-
|
3
1
|
module Shokkenki
|
4
2
|
module Provider
|
5
3
|
module Model
|
@@ -13,8 +11,7 @@ module Shokkenki
|
|
13
11
|
end
|
14
12
|
|
15
13
|
def self.from_hash hash
|
16
|
-
|
17
|
-
new symbolized_hash[:name], symbolized_hash[:arguments]
|
14
|
+
new hash[:name], hash[:arguments]
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
@@ -7,14 +7,16 @@ module Shokkenki
|
|
7
7
|
module JsonPathsTerm
|
8
8
|
def verify_within context
|
9
9
|
term = self
|
10
|
-
context.describe 'json
|
10
|
+
context.describe 'json' do
|
11
11
|
term.value.each do |json_path, term|
|
12
12
|
describe json_path do
|
13
13
|
|
14
14
|
before(:each) do
|
15
15
|
@actual_values = @actual_values.map do |value|
|
16
|
-
JsonPath.on(value, json_path)
|
16
|
+
JsonPath.on(value, json_path.to_s)
|
17
17
|
end.flatten
|
18
|
+
|
19
|
+
fail 'No matching values found' if @actual_values.empty?
|
18
20
|
end
|
19
21
|
|
20
22
|
term.verify_within self
|
@@ -23,4 +23,6 @@ Shokkenki::Term::HashTerm.send :include, Shokkenki::Provider::RSpec::Term::HashT
|
|
23
23
|
Shokkenki::Term::StringTerm.send :include, Shokkenki::Provider::RSpec::Term::StringTerm
|
24
24
|
Shokkenki::Term::NumberTerm.send :include, Shokkenki::Provider::RSpec::Term::NumberTerm
|
25
25
|
Shokkenki::Term::RegexpTerm.send :include, Shokkenki::Provider::RSpec::Term::RegexpTerm
|
26
|
-
Shokkenki::Term::JsonPathsTerm.send :include, Shokkenki::Provider::RSpec::Term::JsonPathsTerm
|
26
|
+
Shokkenki::Term::JsonPathsTerm.send :include, Shokkenki::Provider::RSpec::Term::JsonPathsTerm
|
27
|
+
|
28
|
+
require_relative 'rspec/rspec_configuration'
|
@@ -8,7 +8,7 @@ module Shokkenki
|
|
8
8
|
class TicketReader
|
9
9
|
|
10
10
|
def read_from location
|
11
|
-
location.respond_to?(:call) ? location.call : parse_from(location)
|
11
|
+
location.respond_to?(:call) ? parse_tickets_json(location.call) : parse_from(location)
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
@@ -19,10 +19,14 @@ module Shokkenki
|
|
19
19
|
|
20
20
|
def parse_from_remote resource
|
21
21
|
open(resource) do |f|
|
22
|
-
|
22
|
+
parse_tickets_json f.read
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
def parse_tickets_json json
|
27
|
+
JSON.parse(json, :symbolize_names => true).map { |h| Shokkenki::Provider::Model::Ticket.from_hash h }
|
28
|
+
end
|
29
|
+
|
26
30
|
def parse_from_local resource
|
27
31
|
Dir.exists?(resource) ? parse_from_directory(resource) : parse_from_file(resource)
|
28
32
|
end
|
metadata
CHANGED
@@ -1,144 +1,141 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shokkenki-provider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Brent Snook
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: activesupport
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
33
|
+
version: 3.0.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
40
|
+
version: 3.0.0
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: faraday
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rack-test
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: jsonpath
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: shokkenki-support
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.0.
|
89
|
+
version: 0.0.5
|
102
90
|
type: :runtime
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.0.
|
96
|
+
version: 0.0.5
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: rake
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- - ~>
|
101
|
+
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: 10.0.0
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- - ~>
|
108
|
+
- - "~>"
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: 10.0.0
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
|
-
name:
|
112
|
+
name: cucumber
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: relish
|
128
127
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
128
|
requirements:
|
131
|
-
- -
|
129
|
+
- - ">="
|
132
130
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
131
|
+
version: '0'
|
134
132
|
type: :development
|
135
133
|
prerelease: false
|
136
134
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
135
|
requirements:
|
139
|
-
- -
|
136
|
+
- - ">="
|
140
137
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
138
|
+
version: '0'
|
142
139
|
description: Example-driven consumer-driven contracts. For providers.
|
143
140
|
email: brent@fuglylogic.com
|
144
141
|
executables: []
|
@@ -157,6 +154,7 @@ files:
|
|
157
154
|
- lib/shokkenki/provider/provider.rb
|
158
155
|
- lib/shokkenki/provider/rspec.rb
|
159
156
|
- lib/shokkenki/provider/rspec/interaction.rb
|
157
|
+
- lib/shokkenki/provider/rspec/rspec_configuration.rb
|
160
158
|
- lib/shokkenki/provider/rspec/term/hash_term.rb
|
161
159
|
- lib/shokkenki/provider/rspec/term/json_paths_term.rb
|
162
160
|
- lib/shokkenki/provider/rspec/term/number_term.rb
|
@@ -169,30 +167,26 @@ files:
|
|
169
167
|
homepage: http://github.com/brentsnook/shokkenki-provider
|
170
168
|
licenses:
|
171
169
|
- GPL2
|
170
|
+
metadata: {}
|
172
171
|
post_install_message:
|
173
172
|
rdoc_options:
|
174
|
-
- --charset=UTF-8
|
173
|
+
- "--charset=UTF-8"
|
175
174
|
require_paths:
|
176
175
|
- lib
|
177
176
|
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
177
|
requirements:
|
180
|
-
- -
|
178
|
+
- - ">="
|
181
179
|
- !ruby/object:Gem::Version
|
182
180
|
version: '1.9'
|
183
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
|
-
none: false
|
185
182
|
requirements:
|
186
|
-
- -
|
183
|
+
- - ">="
|
187
184
|
- !ruby/object:Gem::Version
|
188
185
|
version: '0'
|
189
|
-
segments:
|
190
|
-
- 0
|
191
|
-
hash: -3364088924310902904
|
192
186
|
requirements: []
|
193
187
|
rubyforge_project:
|
194
|
-
rubygems_version:
|
188
|
+
rubygems_version: 2.2.0
|
195
189
|
signing_key:
|
196
|
-
specification_version:
|
197
|
-
summary: shokkenki-0.0.
|
190
|
+
specification_version: 4
|
191
|
+
summary: shokkenki-0.0.5
|
198
192
|
test_files: []
|