webspicy 0.16.2 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -3
  3. data/bin/webspicy +6 -1
  4. data/doc/1-black-box-scene.md +109 -0
  5. data/doc/2-black-box-testing.md +27 -0
  6. data/doc/3-specification-importance.md +41 -0
  7. data/doc/4-sequence-diagram.md +82 -0
  8. data/lib/webspicy.rb +18 -9
  9. data/lib/webspicy/configuration.rb +57 -8
  10. data/lib/webspicy/configuration/scope.rb +22 -16
  11. data/lib/webspicy/formaldoc.fio +7 -5
  12. data/lib/webspicy/specification.rb +10 -9
  13. data/lib/webspicy/specification/condition.rb +48 -0
  14. data/lib/webspicy/specification/err.rb +18 -0
  15. data/lib/webspicy/specification/oldies.rb +4 -0
  16. data/lib/webspicy/specification/oldies/bridge.rb +29 -0
  17. data/lib/webspicy/specification/oldies/errcondition.rb +22 -0
  18. data/lib/webspicy/specification/{postcondition.rb → oldies/postcondition.rb} +6 -0
  19. data/lib/webspicy/specification/{precondition.rb → oldies/precondition.rb} +6 -2
  20. data/lib/webspicy/specification/post.rb +20 -0
  21. data/lib/webspicy/specification/post/missing_condition_impl.rb +15 -0
  22. data/lib/webspicy/specification/post/unexpected_condition_impl.rb +15 -0
  23. data/lib/webspicy/specification/pre.rb +19 -0
  24. data/lib/webspicy/specification/{precondition → pre}/global_request_headers.rb +4 -4
  25. data/lib/webspicy/specification/{precondition → pre}/robust_to_invalid_input.rb +5 -5
  26. data/lib/webspicy/specification/service.rb +58 -24
  27. data/lib/webspicy/specification/test_case.rb +10 -17
  28. data/lib/webspicy/support.rb +32 -0
  29. data/lib/webspicy/support/data_object.rb +25 -0
  30. data/lib/webspicy/support/hooks.rb +65 -0
  31. data/lib/webspicy/support/world.rb +47 -0
  32. data/lib/webspicy/tester.rb +180 -60
  33. data/lib/webspicy/tester/asserter.rb +9 -4
  34. data/lib/webspicy/tester/assertions.rb +8 -9
  35. data/lib/webspicy/tester/client.rb +4 -50
  36. data/lib/webspicy/tester/failure.rb +6 -0
  37. data/lib/webspicy/tester/fakeses.rb +41 -0
  38. data/lib/webspicy/tester/fakeses/email.rb +38 -0
  39. data/lib/webspicy/tester/fakesmtp.rb +39 -0
  40. data/lib/webspicy/tester/fakesmtp/email.rb +27 -0
  41. data/lib/webspicy/tester/file_checker.rb +22 -0
  42. data/lib/webspicy/tester/invocation.rb +15 -196
  43. data/lib/webspicy/tester/reporter.rb +85 -0
  44. data/lib/webspicy/tester/reporter/composite.rb +38 -0
  45. data/lib/webspicy/tester/reporter/documentation.rb +74 -0
  46. data/lib/webspicy/tester/reporter/error_count.rb +25 -0
  47. data/lib/webspicy/tester/reporter/exceptions.rb +62 -0
  48. data/lib/webspicy/tester/reporter/file_progress.rb +25 -0
  49. data/lib/webspicy/tester/reporter/file_summary.rb +43 -0
  50. data/lib/webspicy/tester/reporter/progress.rb +30 -0
  51. data/lib/webspicy/tester/reporter/summary.rb +63 -0
  52. data/lib/webspicy/tester/result.rb +142 -0
  53. data/lib/webspicy/tester/result/assert_met.rb +29 -0
  54. data/lib/webspicy/tester/result/check.rb +33 -0
  55. data/lib/webspicy/tester/result/errcondition_met.rb +29 -0
  56. data/lib/webspicy/tester/result/error_schema_met.rb +24 -0
  57. data/lib/webspicy/tester/result/invocation_succeeded.rb +13 -0
  58. data/lib/webspicy/tester/result/output_schema_met.rb +24 -0
  59. data/lib/webspicy/tester/result/postcondition_met.rb +29 -0
  60. data/lib/webspicy/tester/result/response_header_met.rb +43 -0
  61. data/lib/webspicy/tester/result/response_status_met.rb +25 -0
  62. data/lib/webspicy/version.rb +2 -2
  63. data/lib/webspicy/web.rb +4 -0
  64. data/lib/webspicy/web/client.rb +15 -0
  65. data/lib/webspicy/{tester → web}/client/http_client.rb +34 -14
  66. data/lib/webspicy/{tester → web}/client/rack_test_client.rb +3 -3
  67. data/lib/webspicy/{tester → web}/client/support.rb +2 -2
  68. data/lib/webspicy/web/invocation.rb +65 -0
  69. data/lib/webspicy/web/mocker.rb +90 -0
  70. data/lib/webspicy/{mocker → web/mocker}/config.ru +3 -2
  71. data/lib/webspicy/{openapi.rb → web/openapi.rb} +0 -0
  72. data/lib/webspicy/web/openapi/generator.rb +129 -0
  73. data/spec/unit/configuration/scope/test_each_service.rb +2 -2
  74. data/spec/unit/configuration/scope/test_each_specification.rb +7 -7
  75. data/spec/unit/specification/{precondition → pre}/test_global_request_headers.rb +9 -4
  76. data/spec/unit/specification/test_condition.rb +44 -0
  77. data/spec/unit/support/hooks/test_fire_after_each.rb +53 -0
  78. data/spec/unit/{tester/client/test_around.rb → support/hooks/test_fire_around.rb} +15 -10
  79. data/spec/unit/support/hooks/test_fire_before_each.rb +53 -0
  80. data/spec/unit/support/world/fixtures/array.json +8 -0
  81. data/spec/unit/support/world/fixtures/queue.rb +1 -0
  82. data/spec/unit/support/world/fixtures/single.json +11 -0
  83. data/spec/unit/support/world/fixtures/yaml.yml +3 -0
  84. data/spec/unit/support/world/test_world.rb +56 -0
  85. data/spec/unit/test_configuration.rb +50 -1
  86. data/spec/unit/tester/fakeses/test_email.rb +40 -0
  87. data/spec/unit/tester/test_asserter.rb +198 -3
  88. data/spec/unit/tester/test_assertions.rb +8 -6
  89. data/spec/unit/web/mocker/test_mocker.rb +35 -0
  90. data/spec/unit/web/openapi/test_generator.rb +31 -0
  91. metadata +90 -67
  92. data/examples/restful/Gemfile +0 -5
  93. data/examples/restful/Gemfile.lock +0 -105
  94. data/examples/restful/Rakefile +0 -25
  95. data/examples/restful/app.rb +0 -180
  96. data/examples/restful/webspicy/config.rb +0 -23
  97. data/examples/restful/webspicy/rack.rb +0 -7
  98. data/examples/restful/webspicy/real.rb +0 -8
  99. data/examples/restful/webspicy/schema.fio +0 -20
  100. data/examples/restful/webspicy/support/must_be_an_admin.rb +0 -20
  101. data/examples/restful/webspicy/support/must_be_authenticated.rb +0 -48
  102. data/examples/restful/webspicy/support/todo_removed.rb +0 -18
  103. data/examples/restful/webspicy/todo/deleteTodo.yml +0 -52
  104. data/examples/restful/webspicy/todo/getTodo.yml +0 -50
  105. data/examples/restful/webspicy/todo/getTodoSingleServiceFormat.yml +0 -46
  106. data/examples/restful/webspicy/todo/getTodos.yml +0 -36
  107. data/examples/restful/webspicy/todo/options.yml +0 -32
  108. data/examples/restful/webspicy/todo/patchTodo.yml +0 -66
  109. data/examples/restful/webspicy/todo/postCsv.yml +0 -43
  110. data/examples/restful/webspicy/todo/postFile.yml +0 -40
  111. data/examples/restful/webspicy/todo/postTodos.yml +0 -51
  112. data/examples/restful/webspicy/todo/putTodo.yml +0 -65
  113. data/examples/restful/webspicy/todo/todos.csv +0 -4
  114. data/examples/single_spec/spec.yml +0 -59
  115. data/examples/website/config.rb +0 -2
  116. data/examples/website/schema.fio +0 -1
  117. data/examples/website/specification/get-http.yml +0 -30
  118. data/examples/website/specification/get-https.yml +0 -30
  119. data/lib/webspicy/checker.rb +0 -25
  120. data/lib/webspicy/mocker.rb +0 -88
  121. data/lib/webspicy/openapi/generator.rb +0 -127
  122. data/lib/webspicy/tester/rspec_asserter.rb +0 -108
  123. data/lib/webspicy/tester/rspec_matchers.rb +0 -104
  124. data/spec/unit/mocker/test_mocker.rb +0 -32
  125. data/spec/unit/openapi/test_generator.rb +0 -28
@@ -3,10 +3,75 @@ require 'spec_helper'
3
3
  module Webspicy
4
4
  class Tester
5
5
  describe Asserter do
6
- let(:asserter) { Asserter.new(target) }
6
+ describe '#includes' do
7
+ it 'returns nil when the value is found in an array' do
8
+ expect(Asserter.new([:a, 'foo', 99]).includes('', 'foo'))
9
+ .to eq nil
10
+ end
11
+
12
+ it 'returns nil when the assertion is identical to a non-array' do
13
+ expect(Asserter.new({ foo: Time.at(0) }).includes('', { foo: Time.at(0) }))
14
+ .to eq nil
15
+ end
16
+
17
+ it 'raises an exception with a descriptive message when the assertion is false' do
18
+ expect { Asserter.new([:a, 'foo', 99]).includes('', 42) }
19
+ .to raise_exception Failure,
20
+ 'Expected ["a","foo",99] to include 42'
21
+
22
+ end
23
+ end
24
+
25
+ describe '#notIncludes' do
26
+ it 'returns nil when the value is not found in an array' do
27
+ expect(Asserter.new([:a, 'foo', 99]).notIncludes('', 'boom'))
28
+ .to eq nil
29
+ end
30
+
31
+ it 'returns nil when the assertion and target are not identical' do
32
+ expect(Asserter.new({ foo: Time.at(0) }).notIncludes('', 'LOL'))
33
+ .to eq nil
34
+ end
35
+
36
+ it 'raises an exception with a descriptive message when the assertion is false' do
37
+ expect { Asserter.new([:a, 'foo', 99]).notIncludes('', 'foo') }
38
+ .to raise_exception Failure,
39
+ 'Expected ["a","foo",99] not to include foo'
40
+ end
41
+ end
42
+
43
+ describe '#empty' do
44
+ it 'returns nil when the target is empty' do
45
+ expect(Asserter.new([]).empty).to eq nil
46
+ expect(Asserter.new({}).empty).to eq nil
47
+ end
48
+
49
+ it 'raises an exception with a descriptive message when the assertion is false' do
50
+ expect { Asserter.new(['foo']).empty }
51
+ .to raise_exception Failure,
52
+ 'Expected ["foo"] to be empty'
53
+ end
54
+ end
55
+
56
+ describe '#notEmpty' do
57
+ it 'returns nil when the target is not empty' do
58
+ expect(Asserter.new(['foo']).notEmpty).to eq nil
59
+ expect(Asserter.new({ foo: 'bar' }).notEmpty).to eq nil
60
+ end
61
+
62
+ it 'raises an exception with a descriptive message when the assertion is false' do
63
+ expect { Asserter.new([]).notEmpty }
64
+ .to raise_exception Failure,
65
+ 'Expected [] to be non empty'
66
+ expect { Asserter.new({}).notEmpty }
67
+ .to raise_exception Failure,
68
+ 'Expected {} to be non empty'
69
+ end
70
+ end
7
71
 
8
72
  describe '#size' do
9
73
  let(:target) { [1, 2, 3, 4] }
74
+ let(:asserter) { Asserter.new(target) }
10
75
 
11
76
  it 'returns nil when the assertion is true for a plain array' do
12
77
  expect(asserter.size('', 4)).to eq nil
@@ -14,7 +79,7 @@ module Webspicy
14
79
 
15
80
  it 'raises an exception with a descriptive message when the assertion is false' do
16
81
  expect { asserter.size('', 3) }
17
- .to raise_exception RuntimeError, 'Expected [1,2,3,4] to have a size of 3, actual size is: 4'
82
+ .to raise_exception Failure, 'Expected [1,2,3,4] to have a size of 3, actual size is: 4'
18
83
  end
19
84
 
20
85
  context 'with a string' do
@@ -34,7 +99,7 @@ module Webspicy
34
99
 
35
100
  it 'raises an exception with a descriptive message when the assertion is false' do
36
101
  expect { asserter.size('foo/2/bar', 99) }
37
- .to raise_exception RuntimeError,
102
+ .to raise_exception Failure,
38
103
  'Expected [10,11,12] to have a size of 99, actual size is: 3'
39
104
  end
40
105
 
@@ -45,6 +110,136 @@ module Webspicy
45
110
  end
46
111
  end
47
112
  end
113
+
114
+ describe '#idIn' do
115
+ it 'returns nil when the specified ids match exactly' do
116
+ expect(Asserter.new([{ id: 1 }, { id: 2 }]).idIn('', 1, 2)).to eq nil
117
+ expect(Asserter.new({ id: 123 }).idIn('', 123)).to eq nil
118
+
119
+ os = OpenStruct.new(id: 'foo')
120
+ expect(Asserter.new(os).idIn('', 'foo')).to eq nil
121
+ end
122
+
123
+ it 'raises an exception with a descriptive message when the assertion is false' do
124
+ expect { Asserter.new([{ id: 1}, { id: 2}]).idIn('', 123, 125) }
125
+ .to raise_exception Failure,
126
+ 'Expected [{"id":1},{"id":2}] to have ids 123,125'
127
+ expect { Asserter.new([{ id: 1}, { id: 2}]).idIn('', 1, 2, 3) }
128
+ .to raise_exception Failure,
129
+ 'Expected [{"id":1},{"id":2}] to have ids 1,2,3'
130
+ expect { Asserter.new([{ id: 1}, { id: 2}]).idIn('', 1) }
131
+ .to raise_exception Failure,
132
+ 'Expected [{"id":1},{"id":2}] to have ids 1'
133
+ end
134
+ end
135
+
136
+ describe '#idNotIn' do
137
+ it 'returns nil when the specified ids do not match exactly' do
138
+ expect(Asserter.new([{ id: 1 }, { id: 2 }]).idNotIn('', 123, 125)).to eq nil
139
+ expect(Asserter.new({ id: 123 }).idNotIn('', 1, 2, 3)).to eq nil
140
+ expect(Asserter.new({ id: 123 }).idNotIn('', 1)).to eq nil
141
+ end
142
+
143
+ it 'raises an exception with a descriptive message when the assertion is false' do
144
+ expect { Asserter.new([{ id: 1}, { id: 2}]).idNotIn('', 1, 2) }
145
+ .to raise_exception Failure,
146
+ 'Expected [{"id":1},{"id":2}] to not have ids 1,2'
147
+ expect { Asserter.new({ id: 1}).idNotIn('', 1) }
148
+ .to raise_exception Failure,
149
+ 'Expected {"id":1} to not have ids 1'
150
+
151
+ os = OpenStruct.new(id: 'foo')
152
+ expect { Asserter.new(os).idNotIn('', 'foo') }
153
+ .to raise_exception Failure,
154
+ 'Expected "#<OpenStruct id=\"foo\">"... to not have ids foo'
155
+ end
156
+ end
157
+ end
158
+
159
+ describe '#idFD' do
160
+ let(:target) do
161
+ [
162
+ { id: 1, a: 'a1', b: 'b1' },
163
+ { id: 2, a: 'a2', b: 'b2' }
164
+ ]
165
+ end
166
+
167
+ it 'returns nil when the element with specified id matches the expected keys-value pairs' do
168
+ expect(Asserter.new(target).idFD('', 2, { b: 'b2' })).to eq nil
169
+ expect(Asserter.new(target).idFD('', 2, { a: 'a2', b: 'b2' })).to eq nil
170
+ end
171
+
172
+ it 'raises an exception when the assertion is false' do
173
+ expect { Asserter.new(target).idFD('', 2, { c: 'c2' }) }
174
+ .to raise_exception Failure,
175
+ 'Expected [{"id":1,"a":"a1","b":"b1"... ' \
176
+ 'to contain the key(s) and value(s) {:c=>"c2"}'
177
+ expect { Asserter.new(target).idFD('', 2, { b: 'b1' }) }
178
+ .to raise_exception Failure,
179
+ 'Expected [{"id":1,"a":"a1","b":"b1"... ' \
180
+ 'to contain the key(s) and value(s) {:b=>"b1"}'
181
+ end
182
+
183
+ it 'raises an exception with a descriptive message when no element with the specified id is present in target' do
184
+ expect { Asserter.new(target).idFD('', 3, { a: 'a3' }) }
185
+ .to raise_exception Failure,
186
+ 'Expected an element with id 3 to contain ' \
187
+ 'the key(s) and value(s) {:a=>"a3"}, '\
188
+ 'but there is no element with that id'
189
+ end
190
+ end
191
+
192
+ describe '#pathFD' do
193
+ let(:target) do
194
+ [
195
+ { a: 'a1', b: 'b1' },
196
+ { a: 'a2', b: 'b2' }
197
+ ]
198
+ end
199
+
200
+ it 'returns nil when the target matches the expected keys-value pairs' do
201
+ expect(Asserter.new(target).pathFD('0', { b: 'b1' })).to eq nil
202
+ expect(Asserter.new(target).pathFD('0', { a: 'a1', b: 'b1' })).to eq nil
203
+ expect(Asserter.new(target).pathFD('1', { b: 'b2' })).to eq nil
204
+ expect(Asserter.new(target).pathFD('1', { a: 'a2', b: 'b2' })).to eq nil
205
+ end
206
+
207
+ it 'raises an exception when the assertion is false' do
208
+ expect { Asserter.new(target).pathFD('0', { c: 'c2' }) }
209
+ .to raise_exception Failure,
210
+ 'Expected {"a":"a1","b":"b1"} ' \
211
+ 'to contain the key(s) and value(s) {:c=>"c2"}'
212
+ expect { Asserter.new(target).pathFD('0', { b: 'b2' }) }
213
+ .to raise_exception Failure,
214
+ 'Expected {"a":"a1","b":"b1"} ' \
215
+ 'to contain the key(s) and value(s) {:b=>"b2"}'
216
+ end
217
+ end
218
+
219
+ describe '#match' do
220
+ it 'returns nil when the target matches the specified regexp' do
221
+ expect(Asserter.new('Empathise').match('', /path/)).to eq nil
222
+ expect(Asserter.new('Empathise').match('', /.mp/)).to eq nil
223
+ end
224
+
225
+ it 'raises an exception when the assertion is false' do
226
+ expect { Asserter.new('Empathise').match('', /ize/) }
227
+ .to raise_exception Failure,
228
+ 'Expected "Empathise" to match /ize/'
229
+ end
230
+ end
231
+
232
+ describe '#notMatch' do
233
+ it 'returns nil when the target does not matche the specified regexp' do
234
+ expect(Asserter.new('Empathise').notMatch('', /ize/)).to eq nil
235
+ expect(Asserter.new('Empathise').notMatch('', /^path/)).to eq nil
236
+ end
237
+
238
+ it 'raises an exception when the assertion is false' do
239
+ expect { Asserter.new('Empathise').notMatch('', /path/) }
240
+ .to raise_exception Failure,
241
+ 'Expected "Empathise" not to match /path/'
242
+ end
48
243
  end
49
244
  end
50
245
  end
@@ -96,14 +96,16 @@ module Webspicy
96
96
  { id: 1, bar: "bar" },
97
97
  { id: 2, bar: "baz" }
98
98
  ] }
99
- expect(idFD(target, 'foo', 1, bar: "bar")).to be(true)
100
- expect(idFD(target, 'foo', 1, bar: "baz")).to be(false)
101
- expect(idFD(target, 'foo', 1, baz: "boz")).to be(false)
99
+ element = element_with_id(target, 'foo', 1)
100
+ expect(idFD(element, bar: "bar")).to be(true)
101
+ expect(idFD(element, bar: "baz")).to be(false)
102
+ expect(idFD(element, baz: "boz")).to be(false)
102
103
 
103
104
  target = { foo: { id: 1, bar: "bar" } }
104
- expect(idFD(target, 'foo', 1, bar: "bar")).to be(true)
105
- expect(idFD(target, 'foo', 1, bar: "baz")).to be(false)
106
- expect(idFD(target, 'foo', 1, baz: "boz")).to be(false)
105
+ element = element_with_id(target, 'foo', 1)
106
+ expect(idFD(element, bar: "bar")).to be(true)
107
+ expect(idFD(element, bar: "baz")).to be(false)
108
+ expect(idFD(element, baz: "boz")).to be(false)
107
109
  end
108
110
 
109
111
  it 'has a pathFD assertion' do
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+ require 'rack/test'
3
+ require 'webspicy/web'
4
+ require 'webspicy/web/mocker'
5
+ module Webspicy
6
+ module Web
7
+ describe Mocker do
8
+ include Rack::Test::Methods
9
+
10
+ let(:app) {
11
+ Mocker.new(Configuration.dress(restful_folder))
12
+ }
13
+
14
+ it 'works as expected' do
15
+ get '/todo/'
16
+ expect(last_response.status).to eql(200)
17
+ expect(last_response.body).not_to be_empty
18
+ end
19
+
20
+ it 'supports CORS on OPTIONS' do
21
+ options '/todo/'
22
+ expect(last_response.status).to eql(204)
23
+ expect(last_response.body).to be_empty
24
+ end
25
+
26
+ it 'returns the correct status code, taken from first example' do
27
+ delete '/todo/1'
28
+ expect(last_response.status).to eql(204)
29
+ expect(last_response.body).to be_empty
30
+ expect(last_response["Content-Type"]).to be_nil
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+ require 'webspicy/web'
3
+ require 'webspicy/web/openapi'
4
+ require 'openapi3_parser'
5
+ module Webspicy
6
+ module Web
7
+ module Openapi
8
+ describe Generator do
9
+
10
+ let(:config) {
11
+ Configuration.new(restful_folder)
12
+ }
13
+
14
+ subject {
15
+ ruby_objs = Generator.new(config).call
16
+ JSON.parse(ruby_objs.to_json)
17
+ }
18
+
19
+ it 'works fine' do
20
+ document = Openapi3Parser.load(subject)
21
+ #puts JSON.pretty_generate(subject)
22
+ document.errors.each do |err|
23
+ puts err.inspect
24
+ end unless document.errors.empty?
25
+ expect(document.errors).to be_empty
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webspicy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.2
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-18 00:00:00.000000000 Z
11
+ date: 2021-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '12'
19
+ version: '13'
20
20
  type: :development
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: '12'
26
+ version: '13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sinatra
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.7'
48
- type: :runtime
47
+ version: '3.10'
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.7'
54
+ version: '3.10'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec_junit_formatter
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.4.1
62
- type: :runtime
62
+ type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.9.0
89
+ version: 0.10.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.9.0
96
+ version: 0.10.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: http
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '2'
103
+ version: '4'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '2'
110
+ version: '4'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: path
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -126,22 +126,22 @@ dependencies:
126
126
  name: rack-robustness
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '1.1'
132
129
  - - ">="
133
130
  - !ruby/object:Gem::Version
134
131
  version: 1.1.0
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '1.1'
135
135
  type: :runtime
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '1.1'
142
139
  - - ">="
143
140
  - !ruby/object:Gem::Version
144
141
  version: 1.1.0
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '1.1'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: mustermann
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -209,92 +209,115 @@ files:
209
209
  - README.md
210
210
  - Rakefile
211
211
  - bin/webspicy
212
- - examples/restful/Gemfile
213
- - examples/restful/Gemfile.lock
214
- - examples/restful/Rakefile
215
- - examples/restful/app.rb
216
- - examples/restful/webspicy/config.rb
217
- - examples/restful/webspicy/rack.rb
218
- - examples/restful/webspicy/real.rb
219
- - examples/restful/webspicy/schema.fio
220
- - examples/restful/webspicy/support/must_be_an_admin.rb
221
- - examples/restful/webspicy/support/must_be_authenticated.rb
222
- - examples/restful/webspicy/support/todo_removed.rb
223
- - examples/restful/webspicy/todo/deleteTodo.yml
224
- - examples/restful/webspicy/todo/getTodo.yml
225
- - examples/restful/webspicy/todo/getTodoSingleServiceFormat.yml
226
- - examples/restful/webspicy/todo/getTodos.yml
227
- - examples/restful/webspicy/todo/options.yml
228
- - examples/restful/webspicy/todo/patchTodo.yml
229
- - examples/restful/webspicy/todo/postCsv.yml
230
- - examples/restful/webspicy/todo/postFile.yml
231
- - examples/restful/webspicy/todo/postTodos.yml
232
- - examples/restful/webspicy/todo/putTodo.yml
233
- - examples/restful/webspicy/todo/todos.csv
234
- - examples/single_spec/spec.yml
235
- - examples/website/config.rb
236
- - examples/website/schema.fio
237
- - examples/website/specification/get-http.yml
238
- - examples/website/specification/get-https.yml
212
+ - doc/1-black-box-scene.md
213
+ - doc/2-black-box-testing.md
214
+ - doc/3-specification-importance.md
215
+ - doc/4-sequence-diagram.md
239
216
  - lib/finitio/webspicy/scalars.fio
240
217
  - lib/webspicy.rb
241
- - lib/webspicy/checker.rb
242
218
  - lib/webspicy/configuration.rb
243
219
  - lib/webspicy/configuration/scope.rb
244
220
  - lib/webspicy/configuration/single_url.rb
245
221
  - lib/webspicy/configuration/single_yml_file.rb
246
222
  - lib/webspicy/formaldoc.fio
247
- - lib/webspicy/mocker.rb
248
- - lib/webspicy/mocker/config.ru
249
- - lib/webspicy/openapi.rb
250
- - lib/webspicy/openapi/generator.rb
251
223
  - lib/webspicy/specification.rb
224
+ - lib/webspicy/specification/condition.rb
225
+ - lib/webspicy/specification/err.rb
252
226
  - lib/webspicy/specification/file_upload.rb
253
- - lib/webspicy/specification/postcondition.rb
254
- - lib/webspicy/specification/precondition.rb
255
- - lib/webspicy/specification/precondition/global_request_headers.rb
256
- - lib/webspicy/specification/precondition/robust_to_invalid_input.rb
227
+ - lib/webspicy/specification/oldies.rb
228
+ - lib/webspicy/specification/oldies/bridge.rb
229
+ - lib/webspicy/specification/oldies/errcondition.rb
230
+ - lib/webspicy/specification/oldies/postcondition.rb
231
+ - lib/webspicy/specification/oldies/precondition.rb
232
+ - lib/webspicy/specification/post.rb
233
+ - lib/webspicy/specification/post/missing_condition_impl.rb
234
+ - lib/webspicy/specification/post/unexpected_condition_impl.rb
235
+ - lib/webspicy/specification/pre.rb
236
+ - lib/webspicy/specification/pre/global_request_headers.rb
237
+ - lib/webspicy/specification/pre/robust_to_invalid_input.rb
257
238
  - lib/webspicy/specification/service.rb
258
239
  - lib/webspicy/specification/test_case.rb
259
240
  - lib/webspicy/support.rb
260
241
  - lib/webspicy/support/colorize.rb
242
+ - lib/webspicy/support/data_object.rb
243
+ - lib/webspicy/support/hooks.rb
261
244
  - lib/webspicy/support/status_range.rb
245
+ - lib/webspicy/support/world.rb
262
246
  - lib/webspicy/tester.rb
263
247
  - lib/webspicy/tester/asserter.rb
264
248
  - lib/webspicy/tester/assertions.rb
265
249
  - lib/webspicy/tester/client.rb
266
- - lib/webspicy/tester/client/http_client.rb
267
- - lib/webspicy/tester/client/rack_test_client.rb
268
- - lib/webspicy/tester/client/support.rb
250
+ - lib/webspicy/tester/failure.rb
251
+ - lib/webspicy/tester/fakeses.rb
252
+ - lib/webspicy/tester/fakeses/email.rb
253
+ - lib/webspicy/tester/fakesmtp.rb
254
+ - lib/webspicy/tester/fakesmtp/email.rb
255
+ - lib/webspicy/tester/file_checker.rb
269
256
  - lib/webspicy/tester/invocation.rb
270
- - lib/webspicy/tester/rspec_asserter.rb
271
- - lib/webspicy/tester/rspec_matchers.rb
257
+ - lib/webspicy/tester/reporter.rb
258
+ - lib/webspicy/tester/reporter/composite.rb
259
+ - lib/webspicy/tester/reporter/documentation.rb
260
+ - lib/webspicy/tester/reporter/error_count.rb
261
+ - lib/webspicy/tester/reporter/exceptions.rb
262
+ - lib/webspicy/tester/reporter/file_progress.rb
263
+ - lib/webspicy/tester/reporter/file_summary.rb
264
+ - lib/webspicy/tester/reporter/progress.rb
265
+ - lib/webspicy/tester/reporter/summary.rb
266
+ - lib/webspicy/tester/result.rb
267
+ - lib/webspicy/tester/result/assert_met.rb
268
+ - lib/webspicy/tester/result/check.rb
269
+ - lib/webspicy/tester/result/errcondition_met.rb
270
+ - lib/webspicy/tester/result/error_schema_met.rb
271
+ - lib/webspicy/tester/result/invocation_succeeded.rb
272
+ - lib/webspicy/tester/result/output_schema_met.rb
273
+ - lib/webspicy/tester/result/postcondition_met.rb
274
+ - lib/webspicy/tester/result/response_header_met.rb
275
+ - lib/webspicy/tester/result/response_status_met.rb
272
276
  - lib/webspicy/version.rb
277
+ - lib/webspicy/web.rb
278
+ - lib/webspicy/web/client.rb
279
+ - lib/webspicy/web/client/http_client.rb
280
+ - lib/webspicy/web/client/rack_test_client.rb
281
+ - lib/webspicy/web/client/support.rb
282
+ - lib/webspicy/web/invocation.rb
283
+ - lib/webspicy/web/mocker.rb
284
+ - lib/webspicy/web/mocker/config.ru
285
+ - lib/webspicy/web/openapi.rb
286
+ - lib/webspicy/web/openapi/generator.rb
273
287
  - spec/spec_helper.rb
274
288
  - spec/unit/configuration/config.rb
275
289
  - spec/unit/configuration/scope/test_each_service.rb
276
290
  - spec/unit/configuration/scope/test_each_specification.rb
277
291
  - spec/unit/configuration/scope/test_expand_example.rb
278
292
  - spec/unit/configuration/scope/test_to_real_url.rb
279
- - spec/unit/mocker/test_mocker.rb
280
- - spec/unit/openapi/test_generator.rb
281
- - spec/unit/specification/precondition/test_global_request_headers.rb
293
+ - spec/unit/specification/pre/test_global_request_headers.rb
282
294
  - spec/unit/specification/service/test_dress_params.rb
283
295
  - spec/unit/specification/test_case/test_mutate.rb
296
+ - spec/unit/specification/test_condition.rb
284
297
  - spec/unit/specification/test_instantiate_url.rb
285
298
  - spec/unit/specification/test_url_placeholders.rb
299
+ - spec/unit/support/hooks/test_fire_after_each.rb
300
+ - spec/unit/support/hooks/test_fire_around.rb
301
+ - spec/unit/support/hooks/test_fire_before_each.rb
286
302
  - spec/unit/support/test_status_range.rb
303
+ - spec/unit/support/world/fixtures/array.json
304
+ - spec/unit/support/world/fixtures/queue.rb
305
+ - spec/unit/support/world/fixtures/single.json
306
+ - spec/unit/support/world/fixtures/yaml.yml
307
+ - spec/unit/support/world/test_world.rb
287
308
  - spec/unit/test_configuration.rb
288
- - spec/unit/tester/client/test_around.rb
309
+ - spec/unit/tester/fakeses/test_email.rb
289
310
  - spec/unit/tester/test_asserter.rb
290
311
  - spec/unit/tester/test_assertions.rb
312
+ - spec/unit/web/mocker/test_mocker.rb
313
+ - spec/unit/web/openapi/test_generator.rb
291
314
  - tasks/gem.rake
292
315
  - tasks/test.rake
293
316
  homepage: http://github.com/enspirit/webspicy
294
317
  licenses:
295
318
  - MIT
296
319
  metadata: {}
297
- post_install_message:
320
+ post_install_message:
298
321
  rdoc_options: []
299
322
  require_paths:
300
323
  - lib
@@ -309,8 +332,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
332
  - !ruby/object:Gem::Version
310
333
  version: '0'
311
334
  requirements: []
312
- rubygems_version: 3.1.2
313
- signing_key:
335
+ rubygems_version: 3.0.8
336
+ signing_key:
314
337
  specification_version: 4
315
338
  summary: Webspicy helps testing web services as software operation black boxes!
316
339
  test_files: []