http_stub 0.15.5 → 0.16.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/lib/http_stub.rb +37 -27
  3. data/lib/http_stub/configurer.rb +2 -2
  4. data/lib/http_stub/configurer/dsl/deprecated.rb +60 -0
  5. data/lib/http_stub/configurer/{server/dsl.rb → dsl/sanctioned.rb} +18 -18
  6. data/lib/http_stub/configurer/dsl/scenario_activator.rb +15 -0
  7. data/lib/http_stub/configurer/dsl/scenario_builder.rb +37 -0
  8. data/lib/http_stub/configurer/dsl/stub_activator_builder.rb +24 -0
  9. data/lib/http_stub/configurer/{request → dsl}/stub_builder.rb +4 -3
  10. data/lib/http_stub/configurer/dsl/stub_builder_producer.rb +21 -0
  11. data/lib/http_stub/configurer/request/http/factory.rb +8 -2
  12. data/lib/http_stub/configurer/request/scenario.rb +29 -0
  13. data/lib/http_stub/configurer/server/facade.rb +7 -7
  14. data/lib/http_stub/server/application.rb +21 -14
  15. data/lib/http_stub/server/registry.rb +7 -3
  16. data/lib/http_stub/server/response.rb +3 -3
  17. data/lib/http_stub/server/scenario.rb +12 -0
  18. data/lib/http_stub/server/scenario/activator.rb +25 -0
  19. data/lib/http_stub/server/scenario/controller.rb +36 -0
  20. data/lib/http_stub/server/scenario/instance.rb +36 -0
  21. data/lib/http_stub/server/scenario/request_parser.rb +19 -0
  22. data/lib/http_stub/server/stub.rb +3 -23
  23. data/lib/http_stub/server/stub/controller.rb +30 -0
  24. data/lib/http_stub/server/stub/exact_value_matcher.rb +15 -0
  25. data/lib/http_stub/server/stub/hash_with_string_value_matchers.rb +22 -0
  26. data/lib/http_stub/server/stub/headers.rb +19 -0
  27. data/lib/http_stub/server/stub/instance.rb +31 -0
  28. data/lib/http_stub/server/stub/method.rb +23 -0
  29. data/lib/http_stub/server/stub/omitted_value_matcher.rb +21 -0
  30. data/lib/http_stub/server/stub/payload_file_consolidator.rb +18 -0
  31. data/lib/http_stub/server/stub/regexp_value_matcher.rb +16 -0
  32. data/lib/http_stub/server/stub/registry.rb +31 -0
  33. data/lib/http_stub/server/stub/request_header_parser.rb +19 -0
  34. data/lib/http_stub/server/stub/request_headers.rb +28 -0
  35. data/lib/http_stub/server/stub/request_parameters.rb +23 -0
  36. data/lib/http_stub/server/stub/request_parser.rb +17 -0
  37. data/lib/http_stub/server/stub/response.rb +16 -0
  38. data/lib/http_stub/server/stub/response/base.rb +64 -0
  39. data/lib/http_stub/server/stub/response/file.rb +36 -0
  40. data/lib/http_stub/server/stub/response/text.rb +19 -0
  41. data/lib/http_stub/server/stub/string_value_matcher.rb +31 -0
  42. data/lib/http_stub/server/stub/triggers.rb +25 -0
  43. data/lib/http_stub/server/stub/uri.rb +23 -0
  44. data/lib/http_stub/server/views/_scenario.haml +16 -0
  45. data/lib/http_stub/server/views/application.sass +4 -0
  46. data/lib/http_stub/server/views/scenarios.haml +3 -0
  47. data/lib/http_stub/version.rb +1 -1
  48. data/spec/acceptance/activator_spec.rb +81 -0
  49. data/spec/acceptance/configurer_initialization_spec.rb +158 -0
  50. data/spec/acceptance/scenario_spec.rb +91 -0
  51. data/spec/acceptance/stub_control_values_spec.rb +160 -0
  52. data/spec/acceptance/stub_spec.rb +290 -0
  53. data/spec/acceptance/stub_trigger_spec.rb +144 -0
  54. data/spec/lib/http_stub/configurer/{deprecated_dsl_spec.rb → dsl/deprecated_spec.rb} +21 -13
  55. data/spec/lib/http_stub/configurer/{server/dsl_spec.rb → dsl/sanctioned_spec.rb} +74 -97
  56. data/spec/lib/http_stub/configurer/dsl/scenario_activator_spec.rb +62 -0
  57. data/spec/lib/http_stub/configurer/dsl/scenario_builder_spec.rb +146 -0
  58. data/spec/lib/http_stub/configurer/dsl/stub_activator_builder_spec.rb +120 -0
  59. data/spec/lib/http_stub/configurer/dsl/stub_builder_producer_spec.rb +105 -0
  60. data/spec/lib/http_stub/configurer/{request → dsl}/stub_builder_spec.rb +33 -5
  61. data/spec/lib/http_stub/configurer/request/controllable_value_spec.rb +1 -1
  62. data/spec/lib/http_stub/configurer/request/http/factory_spec.rb +46 -5
  63. data/spec/lib/http_stub/configurer/request/omittable_spec.rb +1 -1
  64. data/spec/lib/http_stub/configurer/request/scenario_spec.rb +69 -0
  65. data/spec/lib/http_stub/configurer/request/stub_spec.rb +2 -2
  66. data/spec/lib/http_stub/configurer/server/facade_spec.rb +17 -17
  67. data/spec/lib/http_stub/configurer_spec.rb +1 -1
  68. data/spec/lib/http_stub/server/application_integration_spec.rb +23 -13
  69. data/spec/lib/http_stub/server/application_spec.rb +40 -38
  70. data/spec/lib/http_stub/server/daemon_spec.rb +2 -2
  71. data/spec/lib/http_stub/server/registry_spec.rb +66 -17
  72. data/spec/lib/http_stub/server/{request_parser_spec.rb → request_file_consolidator_spec.rb} +20 -33
  73. data/spec/lib/http_stub/server/response_pipeline_spec.rb +1 -1
  74. data/spec/lib/http_stub/server/scenario/activator_spec.rb +106 -0
  75. data/spec/lib/http_stub/server/scenario/controller_spec.rb +102 -0
  76. data/spec/lib/http_stub/server/scenario/instance_spec.rb +126 -0
  77. data/spec/lib/http_stub/server/scenario/request_parser_spec.rb +59 -0
  78. data/spec/lib/http_stub/server/scenario_spec.rb +24 -0
  79. data/spec/lib/http_stub/server/{stub_controller_spec.rb → stub/controller_spec.rb} +13 -17
  80. data/spec/lib/http_stub/server/{exact_value_matcher_spec.rb → stub/exact_value_matcher_spec.rb} +3 -3
  81. data/spec/lib/http_stub/server/{hash_with_string_value_matchers_spec.rb → stub/hash_with_string_value_matchers_spec.rb} +7 -5
  82. data/spec/lib/http_stub/server/{headers_spec.rb → stub/headers_spec.rb} +2 -2
  83. data/spec/lib/http_stub/server/stub/instance_spec.rb +201 -0
  84. data/spec/lib/http_stub/server/stub/method_spec.rb +95 -0
  85. data/spec/lib/http_stub/server/{omitted_value_matcher_spec.rb → stub/omitted_value_matcher_spec.rb} +3 -3
  86. data/spec/lib/http_stub/server/{regexp_value_matcher_spec.rb → stub/regexp_value_matcher_spec.rb} +3 -3
  87. data/spec/lib/http_stub/server/stub/registry_integration_spec.rb +56 -0
  88. data/spec/lib/http_stub/server/{stub_registry_spec.rb → stub/registry_spec.rb} +27 -14
  89. data/spec/lib/http_stub/server/{request_header_parser_spec.rb → stub/request_header_parser_spec.rb} +6 -6
  90. data/spec/lib/http_stub/server/stub/request_headers_spec.rb +68 -0
  91. data/spec/lib/http_stub/server/{stub_parameters_spec.rb → stub/request_parameters_spec.rb} +19 -17
  92. data/spec/lib/http_stub/server/stub/request_parser_spec.rb +56 -0
  93. data/spec/lib/http_stub/server/{stub_response → stub/response}/base_spec.rb +5 -5
  94. data/spec/lib/http_stub/server/{stub_response → stub/response}/file_spec.rb +3 -3
  95. data/spec/lib/http_stub/server/{stub_response → stub/response}/text_spec.rb +3 -3
  96. data/spec/lib/http_stub/server/{stub_response_spec.rb → stub/response_spec.rb} +8 -8
  97. data/spec/lib/http_stub/server/{string_value_matcher_spec.rb → stub/string_value_matcher_spec.rb} +25 -13
  98. data/spec/lib/http_stub/server/{stub_triggers_spec.rb → stub/triggers_spec.rb} +7 -9
  99. data/spec/lib/http_stub/server/stub/uri_spec.rb +43 -0
  100. data/spec/lib/http_stub/server/stub_spec.rb +10 -185
  101. data/spec/spec_helper.rb +10 -5
  102. data/spec/support/configurer_integration.rb +24 -0
  103. data/spec/support/scenario_fixture.rb +33 -0
  104. data/spec/support/stub_fixture.rb +1 -1
  105. metadata +126 -84
  106. data/lib/http_stub/configurer/deprecated_dsl.rb +0 -57
  107. data/lib/http_stub/configurer/request/stub_activator.rb +0 -26
  108. data/lib/http_stub/configurer/request/stub_activator_builder.rb +0 -25
  109. data/lib/http_stub/server/exact_value_matcher.rb +0 -13
  110. data/lib/http_stub/server/hash_with_string_value_matchers.rb +0 -20
  111. data/lib/http_stub/server/headers.rb +0 -17
  112. data/lib/http_stub/server/omitted_value_matcher.rb +0 -19
  113. data/lib/http_stub/server/regexp_value_matcher.rb +0 -14
  114. data/lib/http_stub/server/request_header_parser.rb +0 -17
  115. data/lib/http_stub/server/request_parser.rb +0 -29
  116. data/lib/http_stub/server/string_value_matcher.rb +0 -29
  117. data/lib/http_stub/server/stub_activator.rb +0 -30
  118. data/lib/http_stub/server/stub_activator_controller.rb +0 -34
  119. data/lib/http_stub/server/stub_controller.rb +0 -28
  120. data/lib/http_stub/server/stub_headers.rb +0 -24
  121. data/lib/http_stub/server/stub_parameters.rb +0 -21
  122. data/lib/http_stub/server/stub_registry.rb +0 -29
  123. data/lib/http_stub/server/stub_response.rb +0 -14
  124. data/lib/http_stub/server/stub_response/base.rb +0 -62
  125. data/lib/http_stub/server/stub_response/file.rb +0 -34
  126. data/lib/http_stub/server/stub_response/text.rb +0 -17
  127. data/lib/http_stub/server/stub_triggers.rb +0 -23
  128. data/lib/http_stub/server/stub_uri.rb +0 -21
  129. data/lib/http_stub/server/views/stub_activators.haml +0 -6
  130. data/spec/lib/http_stub/configurer/request/stub_activator_builder_spec.rb +0 -119
  131. data/spec/lib/http_stub/configurer/request/stub_activator_spec.rb +0 -45
  132. data/spec/lib/http_stub/configurer_integration_spec.rb +0 -837
  133. data/spec/lib/http_stub/server/stub_activator_controller_spec.rb +0 -95
  134. data/spec/lib/http_stub/server/stub_activator_spec.rb +0 -83
  135. data/spec/lib/http_stub/server/stub_headers_spec.rb +0 -68
  136. data/spec/lib/http_stub/server/stub_registry_integration_spec.rb +0 -62
  137. data/spec/lib/http_stub/server/stub_uri_spec.rb +0 -42
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,7 @@ SimpleCov.start do
7
7
  add_filter "/spec/"
8
8
  add_filter "/vendor/"
9
9
 
10
- minimum_coverage 99.54
10
+ minimum_coverage 99.62
11
11
  refuse_coverage_drop
12
12
  end if ENV["coverage"]
13
13
 
@@ -15,12 +15,14 @@ require 'http_server_manager/test_support'
15
15
 
16
16
  require_relative '../lib/http_stub/rake/task_generators'
17
17
  require_relative '../lib/http_stub'
18
- require_relative '../examples/configurer_with_class_activator'
19
- require_relative '../examples/configurer_with_class_activators'
20
- require_relative '../examples/configurer_with_class_stub'
18
+ require_relative '../examples/configurer_with_stub'
19
+ require_relative '../examples/configurer_with_deprecated_activator'
20
+ require_relative '../examples/configurer_with_trivial_scenarios'
21
+ require_relative '../examples/configurer_with_exhaustive_scenarios'
21
22
  require_relative '../examples/configurer_with_initialize_callback'
22
23
  require_relative '../examples/configurer_with_complex_initializer'
23
24
  require_relative '../examples/configurer_with_response_defaults'
25
+ require_relative '../examples/configurer_with_stub_triggers'
24
26
  require_relative '../examples/configurer_with_file_responses'
25
27
 
26
28
  HttpStub::Server::Daemon.log_dir = ::File.expand_path('../../tmp/log', __FILE__)
@@ -36,4 +38,7 @@ module HttpStub
36
38
 
37
39
  end
38
40
 
39
- Dir[::File.expand_path('../support/**/*.rb', __FILE__)].each { |file| require file }
41
+ require_relative 'support/stub_fixture'
42
+ require_relative 'support/scenario_fixture'
43
+ require_relative 'support/server_integration'
44
+ require_relative 'support/configurer_integration'
@@ -0,0 +1,24 @@
1
+ shared_context "configurer integration" do
2
+ include_context "server integration"
3
+
4
+ let(:stub_server) { configurer.stub_server }
5
+
6
+ before(:example) do
7
+ configurer.class.host(server_host)
8
+ configurer.class.port(server_port)
9
+ end
10
+
11
+ after(:example) do
12
+ stub_server.clear_stubs!
13
+ stub_server.clear_scenarios!
14
+ end
15
+
16
+ def expect_response_to_contain_file(path)
17
+ response_file = Tempfile.new(File.basename(path)).tap do |file|
18
+ file.write(response.parsed_response)
19
+ file.flush
20
+ end
21
+ expect(FileUtils.compare_file(path, response_file.path)).to be(true)
22
+ end
23
+
24
+ end
@@ -0,0 +1,33 @@
1
+ module HttpStub
2
+
3
+ class ScenarioFixture
4
+
5
+ def initialize
6
+ @name = "some/scenario/name"
7
+ @stub_fixtures = []
8
+ @triggered_scenario_names = []
9
+ end
10
+
11
+ def with_name!(name)
12
+ self.tap { @name = name }
13
+ end
14
+
15
+ def with_stubs!(number)
16
+ self.tap { @stub_fixtures.concat((1..number).map { HttpStub::StubFixture.new }) }
17
+ end
18
+
19
+ def with_triggered_scenario_names!(uris)
20
+ self.tap { @triggered_scenario_names.concat(uris) }
21
+ end
22
+
23
+ def server_payload
24
+ {
25
+ "name" => @name,
26
+ "stubs" => @stub_fixtures.map(&:server_payload),
27
+ "triggered_scenario_names" => @triggered_scenario_names
28
+ }
29
+ end
30
+
31
+ end
32
+
33
+ end
@@ -45,7 +45,7 @@ module HttpStub
45
45
  uri: "/stub/uri/#{@id}",
46
46
  method: "some #{@id} method",
47
47
  headers: { "request_header_name" => "request header value #{@id}" },
48
- parameters: { "parameter_name" => "request parameter value #{@id}" }
48
+ parameters: { "parameter_name" => "parameter value #{@id}" }
49
49
  )
50
50
  @response = HttpStub::StubFixture::Part.new(
51
51
  status: 500,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_stub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.5
4
+ version: 0.16.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ueckerman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-27 00:00:00.000000000 Z
12
+ date: 2015-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -257,23 +257,26 @@ extra_rdoc_files: []
257
257
  files:
258
258
  - "./lib/http_stub.rb"
259
259
  - "./lib/http_stub/configurer.rb"
260
- - "./lib/http_stub/configurer/deprecated_dsl.rb"
260
+ - "./lib/http_stub/configurer/dsl/deprecated.rb"
261
+ - "./lib/http_stub/configurer/dsl/sanctioned.rb"
262
+ - "./lib/http_stub/configurer/dsl/scenario_activator.rb"
263
+ - "./lib/http_stub/configurer/dsl/scenario_builder.rb"
264
+ - "./lib/http_stub/configurer/dsl/stub_activator_builder.rb"
265
+ - "./lib/http_stub/configurer/dsl/stub_builder.rb"
266
+ - "./lib/http_stub/configurer/dsl/stub_builder_producer.rb"
261
267
  - "./lib/http_stub/configurer/request/controllable_value.rb"
262
268
  - "./lib/http_stub/configurer/request/http/basic.rb"
263
269
  - "./lib/http_stub/configurer/request/http/factory.rb"
264
270
  - "./lib/http_stub/configurer/request/http/multipart.rb"
265
271
  - "./lib/http_stub/configurer/request/omittable.rb"
266
272
  - "./lib/http_stub/configurer/request/regexpable.rb"
273
+ - "./lib/http_stub/configurer/request/scenario.rb"
267
274
  - "./lib/http_stub/configurer/request/stub.rb"
268
- - "./lib/http_stub/configurer/request/stub_activator.rb"
269
- - "./lib/http_stub/configurer/request/stub_activator_builder.rb"
270
- - "./lib/http_stub/configurer/request/stub_builder.rb"
271
275
  - "./lib/http_stub/configurer/request/stub_response.rb"
272
276
  - "./lib/http_stub/configurer/request/stub_response_file.rb"
273
277
  - "./lib/http_stub/configurer/server/buffered_command_processor.rb"
274
278
  - "./lib/http_stub/configurer/server/command.rb"
275
279
  - "./lib/http_stub/configurer/server/command_processor.rb"
276
- - "./lib/http_stub/configurer/server/dsl.rb"
277
280
  - "./lib/http_stub/configurer/server/facade.rb"
278
281
  - "./lib/http_stub/configurer/server/request_processor.rb"
279
282
  - "./lib/http_stub/extensions/core/hash.rb"
@@ -284,58 +287,73 @@ files:
284
287
  - "./lib/http_stub/rake/task_generators.rb"
285
288
  - "./lib/http_stub/server/application.rb"
286
289
  - "./lib/http_stub/server/daemon.rb"
287
- - "./lib/http_stub/server/exact_value_matcher.rb"
288
- - "./lib/http_stub/server/hash_with_string_value_matchers.rb"
289
- - "./lib/http_stub/server/headers.rb"
290
- - "./lib/http_stub/server/omitted_value_matcher.rb"
291
- - "./lib/http_stub/server/regexp_value_matcher.rb"
292
290
  - "./lib/http_stub/server/registry.rb"
293
- - "./lib/http_stub/server/request_header_parser.rb"
294
- - "./lib/http_stub/server/request_parser.rb"
295
291
  - "./lib/http_stub/server/response.rb"
296
292
  - "./lib/http_stub/server/response_pipeline.rb"
297
- - "./lib/http_stub/server/string_value_matcher.rb"
293
+ - "./lib/http_stub/server/scenario.rb"
294
+ - "./lib/http_stub/server/scenario/activator.rb"
295
+ - "./lib/http_stub/server/scenario/controller.rb"
296
+ - "./lib/http_stub/server/scenario/instance.rb"
297
+ - "./lib/http_stub/server/scenario/request_parser.rb"
298
298
  - "./lib/http_stub/server/stub.rb"
299
- - "./lib/http_stub/server/stub_activator.rb"
300
- - "./lib/http_stub/server/stub_activator_controller.rb"
301
- - "./lib/http_stub/server/stub_controller.rb"
302
- - "./lib/http_stub/server/stub_headers.rb"
303
- - "./lib/http_stub/server/stub_parameters.rb"
304
- - "./lib/http_stub/server/stub_registry.rb"
305
- - "./lib/http_stub/server/stub_response.rb"
306
- - "./lib/http_stub/server/stub_response/base.rb"
307
- - "./lib/http_stub/server/stub_response/file.rb"
308
- - "./lib/http_stub/server/stub_response/text.rb"
309
- - "./lib/http_stub/server/stub_triggers.rb"
310
- - "./lib/http_stub/server/stub_uri.rb"
299
+ - "./lib/http_stub/server/stub/controller.rb"
300
+ - "./lib/http_stub/server/stub/exact_value_matcher.rb"
301
+ - "./lib/http_stub/server/stub/hash_with_string_value_matchers.rb"
302
+ - "./lib/http_stub/server/stub/headers.rb"
303
+ - "./lib/http_stub/server/stub/instance.rb"
304
+ - "./lib/http_stub/server/stub/method.rb"
305
+ - "./lib/http_stub/server/stub/omitted_value_matcher.rb"
306
+ - "./lib/http_stub/server/stub/payload_file_consolidator.rb"
307
+ - "./lib/http_stub/server/stub/regexp_value_matcher.rb"
308
+ - "./lib/http_stub/server/stub/registry.rb"
309
+ - "./lib/http_stub/server/stub/request_header_parser.rb"
310
+ - "./lib/http_stub/server/stub/request_headers.rb"
311
+ - "./lib/http_stub/server/stub/request_parameters.rb"
312
+ - "./lib/http_stub/server/stub/request_parser.rb"
313
+ - "./lib/http_stub/server/stub/response.rb"
314
+ - "./lib/http_stub/server/stub/response/base.rb"
315
+ - "./lib/http_stub/server/stub/response/file.rb"
316
+ - "./lib/http_stub/server/stub/response/text.rb"
317
+ - "./lib/http_stub/server/stub/string_value_matcher.rb"
318
+ - "./lib/http_stub/server/stub/triggers.rb"
319
+ - "./lib/http_stub/server/stub/uri.rb"
320
+ - "./lib/http_stub/server/views/_scenario.haml"
311
321
  - "./lib/http_stub/server/views/_stub.haml"
312
322
  - "./lib/http_stub/server/views/_stub_file_response.haml"
313
323
  - "./lib/http_stub/server/views/_stub_text_response.haml"
314
324
  - "./lib/http_stub/server/views/application.sass"
315
325
  - "./lib/http_stub/server/views/layout.haml"
316
- - "./lib/http_stub/server/views/stub_activators.haml"
326
+ - "./lib/http_stub/server/views/scenarios.haml"
317
327
  - "./lib/http_stub/server/views/stubs.haml"
318
328
  - "./lib/http_stub/version.rb"
329
+ - "./spec/acceptance/activator_spec.rb"
330
+ - "./spec/acceptance/configurer_initialization_spec.rb"
331
+ - "./spec/acceptance/scenario_spec.rb"
332
+ - "./spec/acceptance/stub_control_values_spec.rb"
333
+ - "./spec/acceptance/stub_spec.rb"
334
+ - "./spec/acceptance/stub_trigger_spec.rb"
319
335
  - "./spec/curl_samples.txt"
320
- - "./spec/lib/http_stub/configurer/deprecated_dsl_spec.rb"
336
+ - "./spec/lib/http_stub/configurer/dsl/deprecated_spec.rb"
337
+ - "./spec/lib/http_stub/configurer/dsl/sanctioned_spec.rb"
338
+ - "./spec/lib/http_stub/configurer/dsl/scenario_activator_spec.rb"
339
+ - "./spec/lib/http_stub/configurer/dsl/scenario_builder_spec.rb"
340
+ - "./spec/lib/http_stub/configurer/dsl/stub_activator_builder_spec.rb"
341
+ - "./spec/lib/http_stub/configurer/dsl/stub_builder_producer_spec.rb"
342
+ - "./spec/lib/http_stub/configurer/dsl/stub_builder_spec.rb"
321
343
  - "./spec/lib/http_stub/configurer/request/controllable_value_spec.rb"
322
344
  - "./spec/lib/http_stub/configurer/request/http/basic_spec.rb"
323
345
  - "./spec/lib/http_stub/configurer/request/http/factory_spec.rb"
324
346
  - "./spec/lib/http_stub/configurer/request/http/multipart_spec.rb"
325
347
  - "./spec/lib/http_stub/configurer/request/omittable_spec.rb"
326
348
  - "./spec/lib/http_stub/configurer/request/regexpable_spec.rb"
327
- - "./spec/lib/http_stub/configurer/request/stub_activator_builder_spec.rb"
328
- - "./spec/lib/http_stub/configurer/request/stub_activator_spec.rb"
329
- - "./spec/lib/http_stub/configurer/request/stub_builder_spec.rb"
349
+ - "./spec/lib/http_stub/configurer/request/scenario_spec.rb"
330
350
  - "./spec/lib/http_stub/configurer/request/stub_response_spec.rb"
331
351
  - "./spec/lib/http_stub/configurer/request/stub_spec.rb"
332
352
  - "./spec/lib/http_stub/configurer/server/buffered_command_processor_spec.rb"
333
353
  - "./spec/lib/http_stub/configurer/server/command_processor_integration_spec.rb"
334
354
  - "./spec/lib/http_stub/configurer/server/command_spec.rb"
335
- - "./spec/lib/http_stub/configurer/server/dsl_spec.rb"
336
355
  - "./spec/lib/http_stub/configurer/server/facade_spec.rb"
337
356
  - "./spec/lib/http_stub/configurer/server/request_processor_spec.rb"
338
- - "./spec/lib/http_stub/configurer_integration_spec.rb"
339
357
  - "./spec/lib/http_stub/configurer_spec.rb"
340
358
  - "./spec/lib/http_stub/extensions/core/hash_spec.rb"
341
359
  - "./spec/lib/http_stub/extensions/rack/handler_spec.rb"
@@ -347,34 +365,42 @@ files:
347
365
  - "./spec/lib/http_stub/server/application_spec.rb"
348
366
  - "./spec/lib/http_stub/server/daemon_integration_spec.rb"
349
367
  - "./spec/lib/http_stub/server/daemon_spec.rb"
350
- - "./spec/lib/http_stub/server/exact_value_matcher_spec.rb"
351
- - "./spec/lib/http_stub/server/hash_with_string_value_matchers_spec.rb"
352
- - "./spec/lib/http_stub/server/headers_spec.rb"
353
- - "./spec/lib/http_stub/server/omitted_value_matcher_spec.rb"
354
- - "./spec/lib/http_stub/server/regexp_value_matcher_spec.rb"
355
368
  - "./spec/lib/http_stub/server/registry_spec.rb"
356
- - "./spec/lib/http_stub/server/request_header_parser_spec.rb"
357
- - "./spec/lib/http_stub/server/request_parser_spec.rb"
369
+ - "./spec/lib/http_stub/server/request_file_consolidator_spec.rb"
358
370
  - "./spec/lib/http_stub/server/response_pipeline_spec.rb"
359
371
  - "./spec/lib/http_stub/server/response_spec.rb"
360
- - "./spec/lib/http_stub/server/string_value_matcher_spec.rb"
361
- - "./spec/lib/http_stub/server/stub_activator_controller_spec.rb"
362
- - "./spec/lib/http_stub/server/stub_activator_spec.rb"
363
- - "./spec/lib/http_stub/server/stub_controller_spec.rb"
364
- - "./spec/lib/http_stub/server/stub_headers_spec.rb"
365
- - "./spec/lib/http_stub/server/stub_parameters_spec.rb"
366
- - "./spec/lib/http_stub/server/stub_registry_integration_spec.rb"
367
- - "./spec/lib/http_stub/server/stub_registry_spec.rb"
368
- - "./spec/lib/http_stub/server/stub_response/base_spec.rb"
369
- - "./spec/lib/http_stub/server/stub_response/file_spec.rb"
370
- - "./spec/lib/http_stub/server/stub_response/text_spec.rb"
371
- - "./spec/lib/http_stub/server/stub_response_spec.rb"
372
+ - "./spec/lib/http_stub/server/scenario/activator_spec.rb"
373
+ - "./spec/lib/http_stub/server/scenario/controller_spec.rb"
374
+ - "./spec/lib/http_stub/server/scenario/instance_spec.rb"
375
+ - "./spec/lib/http_stub/server/scenario/request_parser_spec.rb"
376
+ - "./spec/lib/http_stub/server/scenario_spec.rb"
377
+ - "./spec/lib/http_stub/server/stub/controller_spec.rb"
378
+ - "./spec/lib/http_stub/server/stub/exact_value_matcher_spec.rb"
379
+ - "./spec/lib/http_stub/server/stub/hash_with_string_value_matchers_spec.rb"
380
+ - "./spec/lib/http_stub/server/stub/headers_spec.rb"
381
+ - "./spec/lib/http_stub/server/stub/instance_spec.rb"
382
+ - "./spec/lib/http_stub/server/stub/method_spec.rb"
383
+ - "./spec/lib/http_stub/server/stub/omitted_value_matcher_spec.rb"
384
+ - "./spec/lib/http_stub/server/stub/regexp_value_matcher_spec.rb"
385
+ - "./spec/lib/http_stub/server/stub/registry_integration_spec.rb"
386
+ - "./spec/lib/http_stub/server/stub/registry_spec.rb"
387
+ - "./spec/lib/http_stub/server/stub/request_header_parser_spec.rb"
388
+ - "./spec/lib/http_stub/server/stub/request_headers_spec.rb"
389
+ - "./spec/lib/http_stub/server/stub/request_parameters_spec.rb"
390
+ - "./spec/lib/http_stub/server/stub/request_parser_spec.rb"
391
+ - "./spec/lib/http_stub/server/stub/response/base_spec.rb"
392
+ - "./spec/lib/http_stub/server/stub/response/file_spec.rb"
393
+ - "./spec/lib/http_stub/server/stub/response/text_spec.rb"
394
+ - "./spec/lib/http_stub/server/stub/response_spec.rb"
395
+ - "./spec/lib/http_stub/server/stub/string_value_matcher_spec.rb"
396
+ - "./spec/lib/http_stub/server/stub/triggers_spec.rb"
397
+ - "./spec/lib/http_stub/server/stub/uri_spec.rb"
372
398
  - "./spec/lib/http_stub/server/stub_spec.rb"
373
- - "./spec/lib/http_stub/server/stub_triggers_spec.rb"
374
- - "./spec/lib/http_stub/server/stub_uri_spec.rb"
375
399
  - "./spec/resources/sample.pdf"
376
400
  - "./spec/resources/sample.txt"
377
401
  - "./spec/spec_helper.rb"
402
+ - "./spec/support/configurer_integration.rb"
403
+ - "./spec/support/scenario_fixture.rb"
378
404
  - "./spec/support/server_integration.rb"
379
405
  - "./spec/support/stub_fixture.rb"
380
406
  homepage: http://github.com/MYOB-Technology/http_stub
@@ -392,9 +418,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
392
418
  version: 1.9.3
393
419
  required_rubygems_version: !ruby/object:Gem::Requirement
394
420
  requirements:
395
- - - ">="
421
+ - - ">"
396
422
  - !ruby/object:Gem::Version
397
- version: '0'
423
+ version: 1.3.1
398
424
  requirements: []
399
425
  rubyforge_project: http_stub
400
426
  rubygems_version: 2.4.6
@@ -402,26 +428,34 @@ signing_key:
402
428
  specification_version: 4
403
429
  summary: A HTTP Server replaying configured stub responses
404
430
  test_files:
431
+ - "./spec/acceptance/activator_spec.rb"
432
+ - "./spec/acceptance/configurer_initialization_spec.rb"
433
+ - "./spec/acceptance/scenario_spec.rb"
434
+ - "./spec/acceptance/stub_control_values_spec.rb"
435
+ - "./spec/acceptance/stub_spec.rb"
436
+ - "./spec/acceptance/stub_trigger_spec.rb"
405
437
  - "./spec/curl_samples.txt"
406
- - "./spec/lib/http_stub/configurer/deprecated_dsl_spec.rb"
438
+ - "./spec/lib/http_stub/configurer/dsl/deprecated_spec.rb"
439
+ - "./spec/lib/http_stub/configurer/dsl/sanctioned_spec.rb"
440
+ - "./spec/lib/http_stub/configurer/dsl/scenario_activator_spec.rb"
441
+ - "./spec/lib/http_stub/configurer/dsl/scenario_builder_spec.rb"
442
+ - "./spec/lib/http_stub/configurer/dsl/stub_activator_builder_spec.rb"
443
+ - "./spec/lib/http_stub/configurer/dsl/stub_builder_producer_spec.rb"
444
+ - "./spec/lib/http_stub/configurer/dsl/stub_builder_spec.rb"
407
445
  - "./spec/lib/http_stub/configurer/request/controllable_value_spec.rb"
408
446
  - "./spec/lib/http_stub/configurer/request/http/basic_spec.rb"
409
447
  - "./spec/lib/http_stub/configurer/request/http/factory_spec.rb"
410
448
  - "./spec/lib/http_stub/configurer/request/http/multipart_spec.rb"
411
449
  - "./spec/lib/http_stub/configurer/request/omittable_spec.rb"
412
450
  - "./spec/lib/http_stub/configurer/request/regexpable_spec.rb"
413
- - "./spec/lib/http_stub/configurer/request/stub_activator_builder_spec.rb"
414
- - "./spec/lib/http_stub/configurer/request/stub_activator_spec.rb"
415
- - "./spec/lib/http_stub/configurer/request/stub_builder_spec.rb"
451
+ - "./spec/lib/http_stub/configurer/request/scenario_spec.rb"
416
452
  - "./spec/lib/http_stub/configurer/request/stub_response_spec.rb"
417
453
  - "./spec/lib/http_stub/configurer/request/stub_spec.rb"
418
454
  - "./spec/lib/http_stub/configurer/server/buffered_command_processor_spec.rb"
419
455
  - "./spec/lib/http_stub/configurer/server/command_processor_integration_spec.rb"
420
456
  - "./spec/lib/http_stub/configurer/server/command_spec.rb"
421
- - "./spec/lib/http_stub/configurer/server/dsl_spec.rb"
422
457
  - "./spec/lib/http_stub/configurer/server/facade_spec.rb"
423
458
  - "./spec/lib/http_stub/configurer/server/request_processor_spec.rb"
424
- - "./spec/lib/http_stub/configurer_integration_spec.rb"
425
459
  - "./spec/lib/http_stub/configurer_spec.rb"
426
460
  - "./spec/lib/http_stub/extensions/core/hash_spec.rb"
427
461
  - "./spec/lib/http_stub/extensions/rack/handler_spec.rb"
@@ -433,33 +467,41 @@ test_files:
433
467
  - "./spec/lib/http_stub/server/application_spec.rb"
434
468
  - "./spec/lib/http_stub/server/daemon_integration_spec.rb"
435
469
  - "./spec/lib/http_stub/server/daemon_spec.rb"
436
- - "./spec/lib/http_stub/server/exact_value_matcher_spec.rb"
437
- - "./spec/lib/http_stub/server/hash_with_string_value_matchers_spec.rb"
438
- - "./spec/lib/http_stub/server/headers_spec.rb"
439
- - "./spec/lib/http_stub/server/omitted_value_matcher_spec.rb"
440
- - "./spec/lib/http_stub/server/regexp_value_matcher_spec.rb"
441
470
  - "./spec/lib/http_stub/server/registry_spec.rb"
442
- - "./spec/lib/http_stub/server/request_header_parser_spec.rb"
443
- - "./spec/lib/http_stub/server/request_parser_spec.rb"
471
+ - "./spec/lib/http_stub/server/request_file_consolidator_spec.rb"
444
472
  - "./spec/lib/http_stub/server/response_pipeline_spec.rb"
445
473
  - "./spec/lib/http_stub/server/response_spec.rb"
446
- - "./spec/lib/http_stub/server/string_value_matcher_spec.rb"
447
- - "./spec/lib/http_stub/server/stub_activator_controller_spec.rb"
448
- - "./spec/lib/http_stub/server/stub_activator_spec.rb"
449
- - "./spec/lib/http_stub/server/stub_controller_spec.rb"
450
- - "./spec/lib/http_stub/server/stub_headers_spec.rb"
451
- - "./spec/lib/http_stub/server/stub_parameters_spec.rb"
452
- - "./spec/lib/http_stub/server/stub_registry_integration_spec.rb"
453
- - "./spec/lib/http_stub/server/stub_registry_spec.rb"
454
- - "./spec/lib/http_stub/server/stub_response/base_spec.rb"
455
- - "./spec/lib/http_stub/server/stub_response/file_spec.rb"
456
- - "./spec/lib/http_stub/server/stub_response/text_spec.rb"
457
- - "./spec/lib/http_stub/server/stub_response_spec.rb"
474
+ - "./spec/lib/http_stub/server/scenario/activator_spec.rb"
475
+ - "./spec/lib/http_stub/server/scenario/controller_spec.rb"
476
+ - "./spec/lib/http_stub/server/scenario/instance_spec.rb"
477
+ - "./spec/lib/http_stub/server/scenario/request_parser_spec.rb"
478
+ - "./spec/lib/http_stub/server/scenario_spec.rb"
479
+ - "./spec/lib/http_stub/server/stub/controller_spec.rb"
480
+ - "./spec/lib/http_stub/server/stub/exact_value_matcher_spec.rb"
481
+ - "./spec/lib/http_stub/server/stub/hash_with_string_value_matchers_spec.rb"
482
+ - "./spec/lib/http_stub/server/stub/headers_spec.rb"
483
+ - "./spec/lib/http_stub/server/stub/instance_spec.rb"
484
+ - "./spec/lib/http_stub/server/stub/method_spec.rb"
485
+ - "./spec/lib/http_stub/server/stub/omitted_value_matcher_spec.rb"
486
+ - "./spec/lib/http_stub/server/stub/regexp_value_matcher_spec.rb"
487
+ - "./spec/lib/http_stub/server/stub/registry_integration_spec.rb"
488
+ - "./spec/lib/http_stub/server/stub/registry_spec.rb"
489
+ - "./spec/lib/http_stub/server/stub/request_header_parser_spec.rb"
490
+ - "./spec/lib/http_stub/server/stub/request_headers_spec.rb"
491
+ - "./spec/lib/http_stub/server/stub/request_parameters_spec.rb"
492
+ - "./spec/lib/http_stub/server/stub/request_parser_spec.rb"
493
+ - "./spec/lib/http_stub/server/stub/response/base_spec.rb"
494
+ - "./spec/lib/http_stub/server/stub/response/file_spec.rb"
495
+ - "./spec/lib/http_stub/server/stub/response/text_spec.rb"
496
+ - "./spec/lib/http_stub/server/stub/response_spec.rb"
497
+ - "./spec/lib/http_stub/server/stub/string_value_matcher_spec.rb"
498
+ - "./spec/lib/http_stub/server/stub/triggers_spec.rb"
499
+ - "./spec/lib/http_stub/server/stub/uri_spec.rb"
458
500
  - "./spec/lib/http_stub/server/stub_spec.rb"
459
- - "./spec/lib/http_stub/server/stub_triggers_spec.rb"
460
- - "./spec/lib/http_stub/server/stub_uri_spec.rb"
461
501
  - "./spec/resources/sample.pdf"
462
502
  - "./spec/resources/sample.txt"
463
503
  - "./spec/spec_helper.rb"
504
+ - "./spec/support/configurer_integration.rb"
505
+ - "./spec/support/scenario_fixture.rb"
464
506
  - "./spec/support/server_integration.rb"
465
507
  - "./spec/support/stub_fixture.rb"
@@ -1,57 +0,0 @@
1
- module HttpStub
2
- module Configurer
3
-
4
- module DeprecatedDSL
5
-
6
- def self.included(mod)
7
- mod.extend(HttpStub::Configurer::DeprecatedDSL::Methods)
8
- mod.send(:include, HttpStub::Configurer::DeprecatedDSL::Methods)
9
- end
10
-
11
- module Methods
12
-
13
- def server_has_started!
14
- stub_server.has_started!
15
- end
16
-
17
- def stub!(uri, options)
18
- stub_server.add_stub! { |stub| add_stub_options_to_builder(stub, uri, options) }
19
- end
20
-
21
- alias_method :stub_response!, :stub!
22
-
23
- def stub_activator(activation_uri, stub_uri, options)
24
- stub_server.add_activator! do |activator|
25
- activator.on(activation_uri)
26
- add_stub_options_to_builder(activator, stub_uri, options)
27
- end
28
- end
29
-
30
- def activate!(uri)
31
- stub_server.activate!(uri)
32
- end
33
-
34
- def recall_stubs!
35
- stub_server.recall_stubs!
36
- end
37
-
38
- def clear_stubs!
39
- stub_server.clear_stubs!
40
- end
41
-
42
- def clear_activators!
43
- stub_server.clear_activators!
44
- end
45
-
46
- private
47
-
48
- def add_stub_options_to_builder(stub, uri, options)
49
- stub.match_requests(uri, options.slice(:method, :headers, :parameters))
50
- stub.respond_with(options[:response])
51
- end
52
-
53
- end
54
-
55
- end
56
- end
57
- end