http_stub 0.27.0 → 0.28.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/http_stub/client.rb +18 -0
- data/lib/http_stub/client/client.rb +28 -0
- data/lib/http_stub/client/request.rb +38 -0
- data/lib/http_stub/client/server.rb +20 -0
- data/lib/http_stub/client/session.rb +43 -0
- data/lib/http_stub/configurator.rb +61 -0
- data/lib/http_stub/configurator/endpoint_template.rb +24 -0
- data/lib/http_stub/configurator/part.rb +23 -0
- data/lib/http_stub/configurator/scenario.rb +42 -0
- data/lib/http_stub/configurator/server.rb +53 -0
- data/lib/http_stub/configurator/state.rb +41 -0
- data/lib/http_stub/configurator/stub.rb +13 -0
- data/lib/http_stub/configurator/stub/stub.rb +75 -0
- data/lib/http_stub/{configurer/dsl/stub_builder_template.rb → configurator/stub/template.rb} +5 -5
- data/lib/http_stub/extensions/core/object.rb +17 -0
- data/lib/http_stub/rake/server_tasks.rb +2 -14
- data/lib/http_stub/rake/task_generators.rb +3 -3
- data/lib/http_stub/server.rb +110 -0
- data/lib/http_stub/server/application/application.rb +10 -6
- data/lib/http_stub/server/application/request_support.rb +2 -2
- data/lib/http_stub/server/application/routes/memory.rb +1 -6
- data/lib/http_stub/server/application/routes/scenario.rb +1 -11
- data/lib/http_stub/server/application/routes/session.rb +1 -1
- data/lib/http_stub/server/application/routes/status.rb +0 -10
- data/lib/http_stub/server/application/routes/stub.rb +2 -12
- data/lib/http_stub/server/daemon.rb +1 -10
- data/lib/http_stub/server/memory/controller.rb +2 -8
- data/lib/http_stub/server/memory/initial_state.rb +27 -0
- data/lib/http_stub/server/memory/memory.rb +6 -27
- data/lib/http_stub/server/registry.rb +3 -1
- data/lib/http_stub/server/request/factory.rb +3 -3
- data/lib/http_stub/server/response.rb +12 -6
- data/lib/http_stub/server/scenario.rb +2 -2
- data/lib/http_stub/server/scenario/controller.rb +3 -13
- data/lib/http_stub/server/scenario/registry.rb +25 -0
- data/lib/http_stub/server/scenario/scenario.rb +13 -8
- data/lib/http_stub/server/session.rb +0 -1
- data/lib/http_stub/server/session/controller.rb +7 -8
- data/lib/http_stub/server/session/identifier_strategy.rb +9 -2
- data/lib/http_stub/server/session/registry.rb +7 -13
- data/lib/http_stub/server/session/session.rb +4 -8
- data/lib/http_stub/server/stdout_logger.rb +13 -0
- data/lib/http_stub/server/stub.rb +3 -2
- data/lib/http_stub/server/stub/controller.rb +0 -10
- data/lib/http_stub/server/stub/empty.rb +2 -1
- data/lib/http_stub/server/stub/match/controller.rb +1 -1
- data/lib/http_stub/server/stub/match/exact_value_matcher.rb +2 -1
- data/lib/http_stub/server/stub/match/omitted_value_matcher.rb +1 -1
- data/lib/http_stub/server/stub/match/regexp_value_matcher.rb +1 -2
- data/lib/http_stub/server/stub/match/rule/body.rb +7 -29
- data/lib/http_stub/server/stub/match/rule/{json_body.rb → json_schema_body.rb} +1 -1
- data/lib/http_stub/server/stub/match/rule/method.rb +1 -1
- data/lib/http_stub/server/stub/match/rule/schema_body.rb +39 -0
- data/lib/http_stub/server/stub/match/rules.rb +6 -6
- data/lib/http_stub/server/stub/match/string_value_matcher.rb +1 -2
- data/lib/http_stub/server/stub/registry.rb +4 -4
- data/lib/http_stub/server/stub/response.rb +2 -6
- data/lib/http_stub/server/stub/response/blocks.rb +33 -0
- data/lib/http_stub/server/stub/response/body.rb +21 -0
- data/lib/http_stub/server/stub/response/file_body.rb +46 -0
- data/lib/http_stub/server/stub/response/headers.rb +24 -0
- data/lib/http_stub/server/stub/response/response.rb +52 -0
- data/lib/http_stub/server/stub/response/text_body.rb +32 -0
- data/lib/http_stub/server/stub/stub.rb +17 -11
- data/lib/http_stub/server/stub/triggers.rb +16 -5
- data/lib/http_stub/server/views/_file_body_response.haml +1 -0
- data/lib/http_stub/server/views/_response.haml +6 -1
- data/lib/http_stub/server/views/_text_body_response.haml +1 -0
- data/lib/http_stub/server/views/application.sass +31 -31
- data/lib/http_stub/version.rb +1 -1
- data/spec/acceptance/{configurer_part_spec.rb → configurator_part_spec.rb} +8 -8
- data/spec/acceptance/cross_origin_support_spec.rb +9 -11
- data/spec/acceptance/endpoint_template_spec.rb +5 -5
- data/spec/acceptance/scenario_spec.rb +8 -8
- data/spec/acceptance/server_defaults_spec.rb +3 -3
- data/spec/acceptance/server_memory_spec.rb +13 -5
- data/spec/acceptance/server_status_spec.rb +4 -21
- data/spec/acceptance/session_spec.rb +8 -11
- data/spec/acceptance/stub_body_request_matching_spec.rb +9 -9
- data/spec/acceptance/stub_control_values_spec.rb +74 -82
- data/spec/acceptance/stub_match_last_spec.rb +60 -80
- data/spec/acceptance/stub_match_list_spec.rb +30 -66
- data/spec/acceptance/stub_miss_list_spec.rb +19 -27
- data/spec/acceptance/stub_response_block_spec.rb +66 -0
- data/spec/acceptance/stub_spec.rb +109 -185
- data/spec/acceptance/stub_trigger_spec.rb +12 -89
- data/spec/helper.rb +32 -10
- data/spec/lib/http_stub/client/client_spec.rb +109 -0
- data/spec/lib/http_stub/client/request_integration_spec.rb +74 -0
- data/spec/lib/http_stub/client/request_spec.rb +32 -0
- data/spec/lib/http_stub/client/server_spec.rb +75 -0
- data/spec/lib/http_stub/client/session_spec.rb +117 -0
- data/spec/lib/http_stub/client_spec.rb +15 -0
- data/spec/lib/http_stub/{configurer/dsl/server_endpoint_template_spec.rb → configurator/endpoint_template_spec.rb} +49 -38
- data/spec/lib/http_stub/configurator/part_spec.rb +103 -0
- data/spec/lib/http_stub/configurator/scenario_spec.rb +162 -0
- data/spec/lib/http_stub/configurator/server_spec.rb +344 -0
- data/spec/lib/http_stub/configurator/state_spec.rb +113 -0
- data/spec/lib/http_stub/configurator/stub/stub_spec.rb +867 -0
- data/spec/lib/http_stub/{configurer/dsl/stub_builder_template_spec.rb → configurator/stub/template_spec.rb} +46 -44
- data/spec/lib/http_stub/configurator/stub_spec.rb +27 -0
- data/spec/lib/http_stub/configurator_spec.rb +113 -0
- data/spec/lib/http_stub/extensions/core/hash_spec.rb +3 -3
- data/spec/lib/http_stub/extensions/core/object_spec.rb +29 -0
- data/spec/lib/http_stub/rake/server_daemon_tasks_smoke_spec.rb +14 -9
- data/spec/lib/http_stub/rake/server_tasks_smoke_spec.rb +25 -53
- data/spec/lib/http_stub/rake/server_tasks_spec.rb +12 -55
- data/spec/lib/http_stub/server/application/application_spec.rb +4 -49
- data/spec/lib/http_stub/server/application/cross_origin_support_spec.rb +2 -5
- data/spec/lib/http_stub/server/application/request_support_integration_spec.rb +4 -4
- data/spec/lib/http_stub/server/application/request_support_spec.rb +16 -11
- data/spec/lib/http_stub/server/application/routes/memory_spec.rb +1 -21
- data/spec/lib/http_stub/server/application/routes/scenario_spec.rb +4 -56
- data/spec/lib/http_stub/server/application/routes/session_integration_spec.rb +1 -1
- data/spec/lib/http_stub/server/application/routes/status_spec.rb +2 -36
- data/spec/lib/http_stub/server/application/routes/stub_integration_spec.rb +3 -34
- data/spec/lib/http_stub/server/application/routes/stub_spec.rb +6 -55
- data/spec/lib/http_stub/server/daemon_integration_spec.rb +5 -1
- data/spec/lib/http_stub/server/daemon_spec.rb +8 -77
- data/spec/lib/http_stub/server/memory/controller_spec.rb +2 -28
- data/spec/lib/http_stub/server/memory/initial_state_spec.rb +57 -0
- data/spec/lib/http_stub/server/memory/memory_spec.rb +28 -116
- data/spec/lib/http_stub/server/registry_spec.rb +57 -2
- data/spec/lib/http_stub/server/request/factory_spec.rb +8 -6
- data/spec/lib/http_stub/server/response_spec.rb +32 -10
- data/spec/lib/http_stub/server/scenario/controller_spec.rb +14 -53
- data/spec/lib/http_stub/server/scenario/registry_spec.rb +147 -0
- data/spec/lib/http_stub/server/scenario/scenario_spec.rb +8 -10
- data/spec/lib/http_stub/server/scenario_spec.rb +1 -1
- data/spec/lib/http_stub/server/session/controller_spec.rb +4 -5
- data/spec/lib/http_stub/server/session/identifier_strategy_spec.rb +15 -48
- data/spec/lib/http_stub/server/session/registry_spec.rb +15 -28
- data/spec/lib/http_stub/server/session/session_spec.rb +13 -71
- data/spec/lib/http_stub/server/stdout_logger_spec.rb +17 -0
- data/spec/lib/http_stub/server/stub/controller_spec.rb +7 -65
- data/spec/lib/http_stub/server/stub/empty_spec.rb +8 -0
- data/spec/lib/http_stub/server/stub/match/controller_spec.rb +2 -2
- data/spec/lib/http_stub/server/stub/match/exact_value_matcher_spec.rb +49 -11
- data/spec/lib/http_stub/server/stub/match/hash_matcher_spec.rb +4 -4
- data/spec/lib/http_stub/server/stub/match/match_spec.rb +4 -4
- data/spec/lib/http_stub/server/stub/match/miss_spec.rb +2 -2
- data/spec/lib/http_stub/server/stub/match/omitted_value_matcher_spec.rb +31 -12
- data/spec/lib/http_stub/server/stub/match/regexp_value_matcher_spec.rb +20 -11
- data/spec/lib/http_stub/server/stub/match/rule/body_spec.rb +3 -3
- data/spec/lib/http_stub/server/stub/match/rule/{json_body_spec.rb → json_schema_body_spec.rb} +5 -5
- data/spec/lib/http_stub/server/stub/match/rule/method_spec.rb +42 -8
- data/spec/lib/http_stub/server/stub/match/rule/schema_body_spec.rb +64 -0
- data/spec/lib/http_stub/server/stub/match/rules_spec.rb +18 -18
- data/spec/lib/http_stub/server/stub/match/string_value_matcher_spec.rb +10 -63
- data/spec/lib/http_stub/server/stub/registry_integration_spec.rb +11 -28
- data/spec/lib/http_stub/server/stub/registry_spec.rb +6 -13
- data/spec/lib/http_stub/server/stub/response/blocks_spec.rb +64 -0
- data/spec/lib/http_stub/server/stub/response/body_spec.rb +52 -0
- data/spec/lib/http_stub/server/stub/response/file_body_spec.rb +117 -0
- data/spec/lib/http_stub/server/stub/response/headers_spec.rb +89 -0
- data/spec/lib/http_stub/server/stub/response/response_spec.rb +342 -0
- data/spec/lib/http_stub/server/stub/response/text_body_spec.rb +138 -0
- data/spec/lib/http_stub/server/stub/response_spec.rb +23 -32
- data/spec/lib/http_stub/server/stub/stub_spec.rb +33 -39
- data/spec/lib/http_stub/server/stub/triggers_spec.rb +47 -12
- data/spec/lib/http_stub/server/stub_spec.rb +1 -1
- data/spec/support/extensions/core/random.rb +23 -0
- data/spec/support/http_stub/configurator/scenario_builder.rb +35 -0
- data/spec/support/http_stub/configurator/scenario_fixture.rb +39 -0
- data/spec/support/http_stub/configurator/stub_builder.rb +112 -0
- data/spec/support/http_stub/configurator/stub_fixture.rb +58 -0
- data/spec/support/http_stub/configurator_fixture.rb +13 -0
- data/spec/support/http_stub/configurator_with_stub_builder_and_requester.rb +14 -0
- data/spec/support/http_stub/headers_fixture.rb +11 -0
- data/spec/support/http_stub/{html_view_excluding_request_details.rb → html_view_excluding_a_stub_request.rb} +2 -2
- data/spec/support/http_stub/{html_view_including_request_details.rb → html_view_including_a_stub_request.rb} +20 -12
- data/spec/support/http_stub/port.rb +12 -0
- data/spec/support/http_stub/server/application/http_stub_rack_application_test.rb +2 -3
- data/spec/support/http_stub/server/driver.rb +20 -15
- data/spec/support/http_stub/server/memory_fixture.rb +2 -2
- data/spec/support/http_stub/server/request/sinatra_request_fixture.rb +16 -0
- data/spec/support/http_stub/server/request_fixture.rb +11 -6
- data/spec/support/http_stub/server/scenario_fixture.rb +14 -2
- data/spec/support/http_stub/server/session_fixture.rb +2 -16
- data/spec/support/http_stub/server/silent_logger.rb +7 -0
- data/spec/support/http_stub/server/simple_request.rb +17 -0
- data/spec/support/http_stub/server/stub/match/match_fixture.rb +1 -1
- data/spec/support/http_stub/server/stub/response/blocks_fixture.rb +54 -0
- data/spec/support/http_stub/server/stub/response/file_body_fixture.rb +25 -0
- data/spec/support/http_stub/server/stub/response/text_body_fixture.rb +33 -0
- data/spec/support/http_stub/server/stub/response_builder.rb +24 -0
- data/spec/support/http_stub/server/stub/response_fixture.rb +15 -0
- data/spec/support/http_stub/server/stub_fixture.rb +21 -0
- data/spec/support/http_stub/server_integration.rb +9 -6
- data/spec/support/http_stub/stub_requester.rb +37 -0
- data/spec/support/object_convertable_to_json.rb +11 -0
- data/spec/support/rack/rack_application_test.rb +1 -1
- data/spec/support/rack/request_fixture.rb +22 -4
- metadata +166 -207
- data/lib/http_stub.rb +0 -131
- data/lib/http_stub/configurer.rb +0 -42
- data/lib/http_stub/configurer/dsl/request_attribute_referencer.rb +0 -19
- data/lib/http_stub/configurer/dsl/request_referencer.rb +0 -24
- data/lib/http_stub/configurer/dsl/scenario_builder.rb +0 -39
- data/lib/http_stub/configurer/dsl/server.rb +0 -80
- data/lib/http_stub/configurer/dsl/server_endpoint_template.rb +0 -23
- data/lib/http_stub/configurer/dsl/session.rb +0 -51
- data/lib/http_stub/configurer/dsl/session_endpoint_template.rb +0 -22
- data/lib/http_stub/configurer/dsl/session_factory.rb +0 -34
- data/lib/http_stub/configurer/dsl/stub_builder.rb +0 -65
- data/lib/http_stub/configurer/part.rb +0 -23
- data/lib/http_stub/configurer/request/controllable_value.rb +0 -19
- data/lib/http_stub/configurer/request/http/basic.rb +0 -27
- data/lib/http_stub/configurer/request/http/factory.rb +0 -33
- data/lib/http_stub/configurer/request/http/multipart.rb +0 -34
- data/lib/http_stub/configurer/request/omittable.rb +0 -26
- data/lib/http_stub/configurer/request/regexpable.rb +0 -33
- data/lib/http_stub/configurer/request/scenario.rb +0 -29
- data/lib/http_stub/configurer/request/stub.rb +0 -39
- data/lib/http_stub/configurer/request/stub_response.rb +0 -38
- data/lib/http_stub/configurer/request/stub_response_file.rb +0 -20
- data/lib/http_stub/configurer/request/triggers.rb +0 -25
- data/lib/http_stub/configurer/server/buffered_command_processor.rb +0 -24
- data/lib/http_stub/configurer/server/command.rb +0 -22
- data/lib/http_stub/configurer/server/command_processor.rb +0 -35
- data/lib/http_stub/configurer/server/configuration.rb +0 -33
- data/lib/http_stub/configurer/server/facade.rb +0 -61
- data/lib/http_stub/configurer/server/request_processor.rb +0 -30
- data/lib/http_stub/configurer/server/session_facade.rb +0 -57
- data/lib/http_stub/server/application/configuration.rb +0 -38
- data/lib/http_stub/server/application/response_pipeline.rb +0 -20
- data/lib/http_stub/server/application/response_support.rb +0 -19
- data/lib/http_stub/server/scenario/parser.rb +0 -17
- data/lib/http_stub/server/session/configuration.rb +0 -32
- data/lib/http_stub/server/status/controller.rb +0 -25
- data/lib/http_stub/server/stub/parser.rb +0 -17
- data/lib/http_stub/server/stub/payload.rb +0 -20
- data/lib/http_stub/server/stub/payload/base_uri_modifier.rb +0 -17
- data/lib/http_stub/server/stub/payload/response_body_modifier.rb +0 -21
- data/lib/http_stub/server/stub/response/attribute/body.rb +0 -32
- data/lib/http_stub/server/stub/response/attribute/headers.rb +0 -32
- data/lib/http_stub/server/stub/response/attribute/interpolator.rb +0 -26
- data/lib/http_stub/server/stub/response/attribute/interpolator/headers.rb +0 -27
- data/lib/http_stub/server/stub/response/attribute/interpolator/parameters.rb +0 -27
- data/lib/http_stub/server/stub/response/base.rb +0 -61
- data/lib/http_stub/server/stub/response/file.rb +0 -45
- data/lib/http_stub/server/stub/response/text.rb +0 -35
- data/lib/http_stub/server/views/_file_response.haml +0 -1
- data/lib/http_stub/server/views/_text_response.haml +0 -1
- data/spec/acceptance/configurer_initialization_spec.rb +0 -157
- data/spec/acceptance/request_reference_spec.rb +0 -42
- data/spec/lib/http_stub/configurer/dsl/request_attribute_referencer_spec.rb +0 -37
- data/spec/lib/http_stub/configurer/dsl/request_referencer_spec.rb +0 -37
- data/spec/lib/http_stub/configurer/dsl/scenario_builder_spec.rb +0 -201
- data/spec/lib/http_stub/configurer/dsl/server_spec.rb +0 -575
- data/spec/lib/http_stub/configurer/dsl/session_endpoint_template_spec.rb +0 -150
- data/spec/lib/http_stub/configurer/dsl/session_factory_spec.rb +0 -97
- data/spec/lib/http_stub/configurer/dsl/session_spec.rb +0 -210
- data/spec/lib/http_stub/configurer/dsl/stub_builder_spec.rb +0 -747
- data/spec/lib/http_stub/configurer/part_spec.rb +0 -103
- data/spec/lib/http_stub/configurer/request/controllable_value_spec.rb +0 -34
- data/spec/lib/http_stub/configurer/request/http/basic_spec.rb +0 -91
- data/spec/lib/http_stub/configurer/request/http/factory_spec.rb +0 -222
- data/spec/lib/http_stub/configurer/request/http/multipart_spec.rb +0 -118
- data/spec/lib/http_stub/configurer/request/omittable_spec.rb +0 -70
- data/spec/lib/http_stub/configurer/request/regexpable_spec.rb +0 -77
- data/spec/lib/http_stub/configurer/request/scenario_spec.rb +0 -69
- data/spec/lib/http_stub/configurer/request/stub_response_spec.rb +0 -195
- data/spec/lib/http_stub/configurer/request/stub_spec.rb +0 -231
- data/spec/lib/http_stub/configurer/request/triggers_spec.rb +0 -101
- data/spec/lib/http_stub/configurer/server/buffered_command_processor_spec.rb +0 -35
- data/spec/lib/http_stub/configurer/server/command_processor_integration_spec.rb +0 -75
- data/spec/lib/http_stub/configurer/server/command_spec.rb +0 -26
- data/spec/lib/http_stub/configurer/server/configuration_spec.rb +0 -139
- data/spec/lib/http_stub/configurer/server/facade_spec.rb +0 -235
- data/spec/lib/http_stub/configurer/server/request_processor_spec.rb +0 -100
- data/spec/lib/http_stub/configurer/server/session_facade_spec.rb +0 -285
- data/spec/lib/http_stub/configurer_spec.rb +0 -105
- data/spec/lib/http_stub/server/application/configuration_spec.rb +0 -59
- data/spec/lib/http_stub/server/application/response_pipeline_spec.rb +0 -29
- data/spec/lib/http_stub/server/application/response_support_spec.rb +0 -30
- data/spec/lib/http_stub/server/scenario/parser_spec.rb +0 -64
- data/spec/lib/http_stub/server/session/configuration_spec.rb +0 -94
- data/spec/lib/http_stub/server/status/controller_spec.rb +0 -47
- data/spec/lib/http_stub/server/stub/parser_spec.rb +0 -56
- data/spec/lib/http_stub/server/stub/payload/base_uri_modifier_spec.rb +0 -23
- data/spec/lib/http_stub/server/stub/payload/response_body_modifier_spec.rb +0 -84
- data/spec/lib/http_stub/server/stub/payload_spec.rb +0 -33
- data/spec/lib/http_stub/server/stub/response/attribute/body_spec.rb +0 -98
- data/spec/lib/http_stub/server/stub/response/attribute/headers_spec.rb +0 -73
- data/spec/lib/http_stub/server/stub/response/attribute/interpolator/headers_spec.rb +0 -53
- data/spec/lib/http_stub/server/stub/response/attribute/interpolator/parameters_spec.rb +0 -53
- data/spec/lib/http_stub/server/stub/response/attribute/interpolator_spec.rb +0 -41
- data/spec/lib/http_stub/server/stub/response/base_spec.rb +0 -217
- data/spec/lib/http_stub/server/stub/response/file_spec.rb +0 -197
- data/spec/lib/http_stub/server/stub/response/text_spec.rb +0 -182
- data/spec/resources/sample.pdf +0 -0
- data/spec/resources/sample.txt +0 -1
- data/spec/support/http_stub/configurer_integration.rb +0 -24
- data/spec/support/http_stub/empty_configurer.rb +0 -7
- data/spec/support/http_stub/scenario_fixture.rb +0 -33
- data/spec/support/http_stub/stub_fixture.rb +0 -125
- data/spec/support/http_stub/stub_registrator.rb +0 -83
@@ -1,109 +1,73 @@
|
|
1
1
|
describe "Stub match list acceptance" do
|
2
|
-
include_context "
|
2
|
+
include_context "server integration"
|
3
3
|
|
4
4
|
describe "GET /http_stub/stubs/matches" do
|
5
|
+
include_context "configurator with stub builder and requester"
|
5
6
|
|
6
|
-
let(:response)
|
7
|
+
let(:response) do
|
8
|
+
request_prior_to_match_list_request
|
9
|
+
HTTParty.get("#{server_uri}/http_stub/stubs/matches")
|
10
|
+
end
|
7
11
|
let(:response_document) { Nokogiri::HTML(response.body) }
|
8
12
|
|
9
|
-
before(:example) { configure_stub_registrator }
|
10
|
-
|
11
13
|
context "when a request has been made matching a stub" do
|
12
14
|
|
13
|
-
|
14
|
-
stub_registrator.register_stub
|
15
|
-
|
16
|
-
stub_registrator.issue_matching_request
|
17
|
-
end
|
15
|
+
let(:request_prior_to_match_list_request) { stub_requester.issue_matching_request }
|
18
16
|
|
19
|
-
include_context "HTML view including request
|
17
|
+
include_context "HTML view including a stub request"
|
20
18
|
|
21
19
|
it "returns a response body that contains stub response status" do
|
22
|
-
expect(response.body).to match(/#{escape_html(
|
20
|
+
expect(response.body).to match(/#{escape_html(stub_response[:status])}/)
|
23
21
|
end
|
24
22
|
|
25
23
|
it "returns a response body that contains stub response headers" do
|
26
|
-
|
24
|
+
stub_response[:headers].each do |expected_header_key, expected_header_value|
|
27
25
|
expect(response.body).to match(/#{expected_header_key}:#{expected_header_value}/)
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
31
29
|
it "returns a response body that contains stub response body" do
|
32
|
-
expect(response.body).to match(/#{escape_html(
|
30
|
+
expect(response.body).to match(/#{escape_html(stub_response[:body])}/)
|
33
31
|
end
|
34
32
|
|
35
33
|
it "returns a response body that contains a link to the matched stub" do
|
36
34
|
stub_link = response_document.css("a.stub").first
|
37
|
-
expect(
|
35
|
+
expect(stub_builder.stub_uri).to end_with(stub_link["href"])
|
38
36
|
end
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
context "when a request has been made matching a stub whose response includes request references" do
|
43
|
-
|
44
|
-
before(:example) do
|
45
|
-
stub_registrator.with_request_parameters
|
46
|
-
stub_registrator.with_request_interpolation
|
47
|
-
|
48
|
-
stub_registrator.register_stub
|
38
|
+
context "whose response includes request interpolation" do
|
49
39
|
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
it "returns a response body that contains stub response status" do
|
54
|
-
expect(response.body).to match(/#{stub_registrator.stub_response_status}/)
|
55
|
-
end
|
40
|
+
before(:example) { stub_builder.with_request_parameters!.and.with_request_interpolation! }
|
56
41
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
parameter_reference: "parameter value 2"
|
61
|
-
}
|
42
|
+
it "returns a response body that contains the matches response status" do
|
43
|
+
expect(response.body).to match(/#{expected_match_response[:status]}/)
|
44
|
+
end
|
62
45
|
|
63
|
-
|
64
|
-
|
46
|
+
it "returns a response body that contains the matches response headers with interpolated request references" do
|
47
|
+
expected_match_response[:headers].each do |expected_header_key, expected_header_value|
|
48
|
+
expect(response.body).to match(/#{expected_header_key}:#{expected_header_value}/)
|
49
|
+
end
|
65
50
|
end
|
66
|
-
end
|
67
51
|
|
68
|
-
|
69
|
-
|
52
|
+
it "returns a response body that contains the matches response body with interpolated request references" do
|
53
|
+
expect(response.body).to match(/#{escape_html(expected_match_response[:body])}/)
|
54
|
+
end
|
70
55
|
|
71
|
-
|
72
|
-
|
56
|
+
it "returns a response body that contains a link to the matched stub" do
|
57
|
+
stub_link = response_document.css("a.stub").first
|
58
|
+
expect(stub_builder.stub_uri).to end_with(stub_link["href"])
|
59
|
+
end
|
73
60
|
|
74
|
-
it "returns a response body that contains a link to the matched stub" do
|
75
|
-
stub_link = response_document.css("a.stub").first
|
76
|
-
expect(stub_registrator.stub_uri).to end_with(stub_link["href"])
|
77
61
|
end
|
78
62
|
|
79
63
|
end
|
80
64
|
|
81
65
|
context "when a request has been made that does not match a stub" do
|
82
66
|
|
83
|
-
|
84
|
-
|
85
|
-
include_context "HTML view excluding request details"
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
context "when a request has been made configuring a stub" do
|
67
|
+
let(:request_prior_to_match_list_request) { stub_requester.issue_non_matching_request }
|
90
68
|
|
91
|
-
|
92
|
-
|
93
|
-
include_context "HTML view excluding request details"
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
context "when a request has been made configuring a scenario" do
|
98
|
-
|
99
|
-
before(:example) { stub_registrator.register_scenario }
|
100
|
-
|
101
|
-
include_context "HTML view excluding request details"
|
102
|
-
|
103
|
-
end
|
69
|
+
include_context "HTML view excluding a stub request"
|
104
70
|
|
105
|
-
def configure_stub_registrator
|
106
|
-
# intentionally blank
|
107
71
|
end
|
108
72
|
|
109
73
|
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
describe "Stub miss list acceptance" do
|
2
|
-
include_context "
|
2
|
+
include_context "server integration"
|
3
3
|
|
4
4
|
describe "GET /http_stub/stubs/misses" do
|
5
|
+
include_context "configurator with stub builder and requester"
|
5
6
|
|
6
|
-
let(:
|
7
|
-
let(:response_document) { Nokogiri::HTML(response.body) }
|
7
|
+
let(:request_prior_to_miss_list_request) { nil }
|
8
8
|
|
9
|
-
|
9
|
+
let(:response) do
|
10
|
+
request_prior_to_miss_list_request
|
11
|
+
HTTParty.get("#{server_uri}/http_stub/stubs/misses")
|
12
|
+
end
|
13
|
+
let(:response_document) { Nokogiri::HTML(response.body) }
|
10
14
|
|
11
15
|
context "when no miss has been registered" do
|
12
16
|
|
@@ -16,44 +20,32 @@ describe "Stub miss list acceptance" do
|
|
16
20
|
|
17
21
|
end
|
18
22
|
|
19
|
-
context "when
|
20
|
-
|
21
|
-
before(:example) { stub_registrator.issue_matching_request }
|
22
|
-
|
23
|
-
include_context "HTML view including request details"
|
24
|
-
|
25
|
-
end
|
23
|
+
context "when the only request made activates a scenario" do
|
26
24
|
|
27
|
-
|
25
|
+
let(:configurator) { HttpStub::Examples::ConfiguratorWithTrivialScenarios }
|
28
26
|
|
29
|
-
|
30
|
-
stub_registrator.register_stub
|
27
|
+
let(:request_prior_to_miss_list_request) { client.activate!("Scenario 1") }
|
31
28
|
|
32
|
-
|
29
|
+
it "returns a response with an empty request list" do
|
30
|
+
expect(response.body).to_not include("Request")
|
33
31
|
end
|
34
32
|
|
35
|
-
include_context "HTML view excluding request details"
|
36
|
-
|
37
33
|
end
|
38
34
|
|
39
|
-
context "when a request has been made
|
35
|
+
context "when a request has been made that does not match a stub" do
|
40
36
|
|
41
|
-
|
37
|
+
let(:request_prior_to_miss_list_request) { stub_requester.issue_non_matching_request }
|
42
38
|
|
43
|
-
include_context "HTML view
|
39
|
+
include_context "HTML view including a stub request"
|
44
40
|
|
45
41
|
end
|
46
42
|
|
47
|
-
context "when a request has been made
|
48
|
-
|
49
|
-
before(:example) { stub_registrator.register_scenario }
|
43
|
+
context "when a request has been made matching a stub" do
|
50
44
|
|
51
|
-
|
45
|
+
let(:request_prior_to_miss_list_request) { stub_requester.issue_matching_request }
|
52
46
|
|
53
|
-
|
47
|
+
include_context "HTML view excluding a stub request"
|
54
48
|
|
55
|
-
def configure_stub_registrator
|
56
|
-
# intentionally blank
|
57
49
|
end
|
58
50
|
|
59
51
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
describe "Stub response block acceptance" do
|
2
|
+
include_context "server integration"
|
3
|
+
|
4
|
+
context "when a server configured with a stub containing a chain of response blocks is started" do
|
5
|
+
|
6
|
+
let(:configurator) { HttpStub::Examples::ConfiguratorWithResponseBlocks }
|
7
|
+
|
8
|
+
context "and a request is made matching the stub" do
|
9
|
+
|
10
|
+
let(:header_value) { "some header value" }
|
11
|
+
let(:parameter_value) { "some parameter value" }
|
12
|
+
|
13
|
+
let(:response) do
|
14
|
+
HTTParty.get("#{server_uri}/some_path", headers: { "header_name" => header_value },
|
15
|
+
query: { "parameter_name" => parameter_value })
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "the response status" do
|
19
|
+
|
20
|
+
it "is the value from the last declaring block" do
|
21
|
+
expect(response.code).to eql(201)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
context "the response headers" do
|
27
|
+
|
28
|
+
it "include headers from early in the chain that are not overridden" do
|
29
|
+
expect(response.headers["header_defaulted"]).to eql("some default header value")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "includes headers from the last declaring block" do
|
33
|
+
expect(response.headers["header_overridden"]).to eql("some overridden header value")
|
34
|
+
end
|
35
|
+
|
36
|
+
it "includes interpolated values from the request headers" do
|
37
|
+
expect(response.headers["header_referencing_header"]).to eql(header_value)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "includes interpolated values from the request parameters" do
|
41
|
+
expect(response.headers["header_referencing_parameter"]).to eql(parameter_value)
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
context "the response body" do
|
47
|
+
|
48
|
+
it "is the value from the last declaring block" do
|
49
|
+
expect(response.body).to_not eql("some default body")
|
50
|
+
end
|
51
|
+
|
52
|
+
it "includes interpolated values from the request headers" do
|
53
|
+
expect(response.body).to include(header_value)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "includes interpolated values from the request headers" do
|
57
|
+
expect(response.body).to include(parameter_value)
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
@@ -1,297 +1,221 @@
|
|
1
1
|
describe "Stub basics acceptance" do
|
2
|
-
include_context "
|
2
|
+
include_context "server integration"
|
3
3
|
|
4
|
-
|
4
|
+
let(:configurator) { HttpStub::Examples::ConfiguratorWithTrivialStubs }
|
5
5
|
|
6
|
-
|
6
|
+
context "when a stub has no match headers or parameters" do
|
7
7
|
|
8
|
-
|
8
|
+
context "and it contains a body only" do
|
9
9
|
|
10
|
-
|
11
|
-
stub_server.add_stub! do |stub|
|
12
|
-
stub.match_requests(uri: "/stub_with_status", method: :get)
|
13
|
-
stub.respond_with(status: 201, body: "Stub body")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
context "and a matching request is made" do
|
18
|
-
|
19
|
-
let(:response) { HTTParty.get("#{server_uri}/stub_with_status") }
|
20
|
-
|
21
|
-
it "responds with the stubbed status" do
|
22
|
-
expect(response.code).to eql(201)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "replays the stubbed body" do
|
26
|
-
expect(response.body).to eql("Stub body")
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
context "and stubs are cleared" do
|
32
|
-
|
33
|
-
before(:example) { stub_server.clear_stubs! }
|
34
|
-
|
35
|
-
context "and a matching request is made" do
|
36
|
-
|
37
|
-
let(:response) { HTTParty.get("#{server_uri}/stub_with_status") }
|
10
|
+
context "and a matching request is made" do
|
38
11
|
|
39
|
-
|
40
|
-
expect(response.code).to eql(404)
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
12
|
+
let(:response) { HTTParty.get("#{server_uri}/stub_with_body_only") }
|
44
13
|
|
14
|
+
it "replays the stubbed body" do
|
15
|
+
expect(response.body).to eql("Stub body")
|
45
16
|
end
|
46
17
|
|
47
18
|
end
|
48
19
|
|
49
|
-
|
50
|
-
|
51
|
-
before(:example) do
|
52
|
-
stub_server.add_stub! do |stub|
|
53
|
-
stub.match_requests(uri: "/stub_without_status", method: :get)
|
54
|
-
stub.respond_with(body: "Stub body")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
context "and a matching request is made" do
|
59
|
-
|
60
|
-
let(:response) { HTTParty.get("#{server_uri}/stub_without_status") }
|
61
|
-
|
62
|
-
it "replays the stubbed body" do
|
63
|
-
expect(response.body).to eql("Stub body")
|
64
|
-
end
|
20
|
+
end
|
65
21
|
|
66
|
-
|
22
|
+
context "and it contains a response status only" do
|
67
23
|
|
68
|
-
|
24
|
+
context "and a matching request is made" do
|
69
25
|
|
70
|
-
|
26
|
+
let(:response) { HTTParty.get("#{server_uri}/stub_with_status_only") }
|
71
27
|
|
72
|
-
|
73
|
-
|
28
|
+
it "responds with the stubbed status" do
|
29
|
+
expect(response.code).to eql(201)
|
74
30
|
end
|
75
31
|
|
76
|
-
|
77
|
-
|
78
|
-
let(:response) { HTTParty.get("#{server_uri}/stub_without_method") }
|
79
|
-
|
80
|
-
it "replays the stubbed body" do
|
81
|
-
expect(response.body).to eql("Stub body")
|
82
|
-
end
|
83
|
-
|
32
|
+
it "responds with an empty body" do
|
33
|
+
expect(response.body).to eql("")
|
84
34
|
end
|
85
35
|
|
86
36
|
end
|
87
37
|
|
88
38
|
end
|
89
39
|
|
90
|
-
|
40
|
+
end
|
91
41
|
|
92
|
-
|
42
|
+
context "when a stub has match headers" do
|
93
43
|
|
94
|
-
|
95
|
-
stub_server.add_stub! do
|
96
|
-
match_requests(uri: "/stub_with_headers", method: :get, headers: { key: "value" })
|
97
|
-
respond_with(status: 202, body: "Another stub body")
|
98
|
-
end
|
99
|
-
end
|
44
|
+
context "whose values are strings" do
|
100
45
|
|
101
|
-
|
46
|
+
let(:response) do
|
47
|
+
HTTParty.get("#{server_uri}/stub_with_string_match_headers", headers: { "key" => header_value })
|
48
|
+
end
|
102
49
|
|
103
|
-
|
50
|
+
context "and a matching request is made" do
|
104
51
|
|
105
|
-
|
106
|
-
expect(response.code).to eql(202)
|
107
|
-
expect(response.body).to eql("Another stub body")
|
108
|
-
end
|
52
|
+
let(:header_value) { "value" }
|
109
53
|
|
54
|
+
it "replays the stubbed response" do
|
55
|
+
expect(response.body).to eql("String match headers body")
|
110
56
|
end
|
111
57
|
|
112
|
-
|
58
|
+
end
|
113
59
|
|
114
|
-
|
60
|
+
context "and a request with a different header value is made" do
|
115
61
|
|
116
|
-
|
117
|
-
expect(response.code).to eql(404)
|
118
|
-
end
|
62
|
+
let(:header_value) { "other_value" }
|
119
63
|
|
64
|
+
it "responds with a 404 status code" do
|
65
|
+
expect(response.code).to eql(404)
|
120
66
|
end
|
121
67
|
|
122
68
|
end
|
123
69
|
|
124
70
|
end
|
125
71
|
|
126
|
-
|
72
|
+
end
|
127
73
|
|
128
|
-
|
74
|
+
context "when a stub has match parameters" do
|
129
75
|
|
130
|
-
|
131
|
-
stub_server.add_stub! do
|
132
|
-
match_requests(uri: "/stub_with_parameters", method: :get, parameters: { key: "value" })
|
133
|
-
respond_with(status: 202, body: "Another stub body")
|
134
|
-
end
|
135
|
-
end
|
76
|
+
context "whose values are strings" do
|
136
77
|
|
137
|
-
|
78
|
+
let(:response) { HTTParty.get("#{server_uri}/stub_with_string_match_parameters?key=#{parameter_value}") }
|
138
79
|
|
139
|
-
|
80
|
+
context "and a matching request is made" do
|
140
81
|
|
141
|
-
|
142
|
-
expect(response.code).to eql(202)
|
143
|
-
expect(response.body).to eql("Another stub body")
|
144
|
-
end
|
82
|
+
let(:parameter_value) { "value" }
|
145
83
|
|
84
|
+
it "replays the stubbed response" do
|
85
|
+
expect(response.body).to eql("String match parameters body")
|
146
86
|
end
|
147
87
|
|
148
|
-
|
88
|
+
end
|
149
89
|
|
150
|
-
|
90
|
+
context "and a request with different parameters is made" do
|
151
91
|
|
152
|
-
|
153
|
-
expect(response.code).to eql(404)
|
154
|
-
end
|
92
|
+
let(:parameter_value) { "another_value" }
|
155
93
|
|
94
|
+
it "responds with a 404 status code" do
|
95
|
+
expect(response.code).to eql(404)
|
156
96
|
end
|
157
97
|
|
158
98
|
end
|
159
99
|
|
160
|
-
|
100
|
+
end
|
161
101
|
|
162
|
-
|
163
|
-
stub_server.add_stub! do
|
164
|
-
match_requests(uri: "/stub_with_parameters", method: :get, parameters: { key: 88 })
|
165
|
-
respond_with(status: 203, body: "Body for parameter number")
|
166
|
-
end
|
167
|
-
end
|
102
|
+
context "whose values are numerics" do
|
168
103
|
|
169
|
-
|
104
|
+
let(:response) { HTTParty.get("#{server_uri}/stub_with_numeric_match_parameters?key=#{parameter_value}") }
|
170
105
|
|
171
|
-
|
106
|
+
context "and a matching request is made" do
|
172
107
|
|
173
|
-
|
174
|
-
expect(response.code).to eql(203)
|
175
|
-
expect(response.body).to eql("Body for parameter number")
|
176
|
-
end
|
108
|
+
let(:parameter_value) { 88 }
|
177
109
|
|
110
|
+
it "replays the stubbed response" do
|
111
|
+
expect(response.body).to eql("Numeric match parameters body")
|
178
112
|
end
|
179
113
|
|
180
114
|
end
|
181
115
|
|
182
116
|
end
|
183
117
|
|
184
|
-
|
118
|
+
end
|
185
119
|
|
186
|
-
|
120
|
+
describe "when a stub has response headers" do
|
187
121
|
|
188
|
-
|
189
|
-
stub_server.add_stub! do
|
190
|
-
match_requests(uri: "/some_stub_path", method: :get)
|
191
|
-
respond_with(body: "Some stub body", headers: { "content-type" => "application/xhtml" })
|
192
|
-
end
|
193
|
-
end
|
122
|
+
context "including a content-type header" do
|
194
123
|
|
195
|
-
|
196
|
-
response = HTTParty.get("#{server_uri}/some_stub_path")
|
124
|
+
context "and a matching request is made" do
|
197
125
|
|
126
|
+
let(:response) { HTTParty.get("#{server_uri}/stub_with_content_type_header") }
|
127
|
+
|
128
|
+
it "responds with the header" do
|
198
129
|
expect(response.content_type).to eql("application/xhtml")
|
199
130
|
end
|
200
131
|
|
201
132
|
end
|
202
133
|
|
203
|
-
|
204
|
-
|
205
|
-
describe "and an attempt is made to register a response with a other headers" do
|
134
|
+
end
|
206
135
|
|
207
|
-
|
208
|
-
{
|
209
|
-
"some_header" => "some value",
|
210
|
-
"another_header" => "another value",
|
211
|
-
"yet_another_header" => "yet another value"
|
212
|
-
}
|
213
|
-
end
|
136
|
+
context "that are custom" do
|
214
137
|
|
215
|
-
|
216
|
-
stub_server.add_stub! do |stub|
|
217
|
-
stub.match_requests(uri: "/some_stub_path", method: :get)
|
218
|
-
stub.respond_with(body: "Some stub body", headers: response_headers)
|
219
|
-
end
|
220
|
-
end
|
138
|
+
context "and a matching request is made" do
|
221
139
|
|
222
|
-
|
223
|
-
|
140
|
+
let(:expected_response_headers) do
|
141
|
+
{
|
142
|
+
"some_header" => "some value",
|
143
|
+
"another_header" => "another value",
|
144
|
+
"yet_another_header" => "yet another value"
|
145
|
+
}
|
146
|
+
end
|
224
147
|
|
225
|
-
|
226
|
-
end
|
148
|
+
let(:response) { HTTParty.get("#{server_uri}/stub_with_response_headers") }
|
227
149
|
|
150
|
+
it "responds with the headers" do
|
151
|
+
expected_response_headers.each { |key, value| expect(response.headers[key]).to eql(value) }
|
228
152
|
end
|
229
153
|
|
230
154
|
end
|
231
155
|
|
232
156
|
end
|
233
157
|
|
234
|
-
|
158
|
+
end
|
235
159
|
|
236
|
-
|
160
|
+
context "when a stub has a response body that is a file" do
|
237
161
|
|
238
|
-
|
162
|
+
let(:configurator) { HttpStub::Examples::ConfiguratorWithFileResponses }
|
239
163
|
|
240
|
-
|
164
|
+
context "and a request that matches is made" do
|
241
165
|
|
242
|
-
|
166
|
+
context "matching a stub with a custom content-type" do
|
243
167
|
|
244
|
-
|
245
|
-
expect(response.code).to eql(200)
|
246
|
-
end
|
168
|
+
let(:response) { issue_request }
|
247
169
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
it "responds with the configured file" do
|
253
|
-
expect(response).to contain_file(HttpStub::Examples::ConfigurerWithFileResponses::FILE_PATH)
|
254
|
-
end
|
170
|
+
it "responds with a status code of 200" do
|
171
|
+
expect(response.code).to eql(200)
|
172
|
+
end
|
255
173
|
|
256
|
-
|
174
|
+
it "responds with the configured content type" do
|
175
|
+
expect(response.content_type).to eql("application/pdf")
|
176
|
+
end
|
257
177
|
|
258
|
-
|
259
|
-
|
178
|
+
it "responds with the configured file" do
|
179
|
+
expect(response).to contain_file(HttpStub::Examples::ConfiguratorWithFileResponses::FILE_PATH)
|
180
|
+
end
|
260
181
|
|
261
|
-
|
182
|
+
context "and a subsequent request is made that requests the file if it has been modified" do
|
262
183
|
|
263
|
-
|
264
|
-
|
265
|
-
end
|
184
|
+
let(:first_response) { issue_request }
|
185
|
+
let(:file_last_modified_time) { first_response.headers["Last-Modified"] }
|
266
186
|
|
267
|
-
|
268
|
-
expect(second_response.content_type).to be(nil)
|
269
|
-
end
|
187
|
+
let(:second_response) { issue_request("if_modified_since" => file_last_modified_time) }
|
270
188
|
|
271
|
-
|
272
|
-
|
273
|
-
|
189
|
+
it "responds with a status code of 304 to indicate the file is unchanged" do
|
190
|
+
expect(second_response.code).to eql(304)
|
191
|
+
end
|
274
192
|
|
193
|
+
it "responds with no content type" do
|
194
|
+
expect(second_response.content_type).to be(nil)
|
275
195
|
end
|
276
196
|
|
277
|
-
|
278
|
-
|
197
|
+
it "responds with an empty body" do
|
198
|
+
expect(second_response.body).to be(nil)
|
279
199
|
end
|
280
200
|
|
281
201
|
end
|
282
202
|
|
283
|
-
|
203
|
+
def issue_request(headers={})
|
204
|
+
HTTParty.get("#{server_uri}/stub_response_with_file", headers: headers)
|
205
|
+
end
|
284
206
|
|
285
|
-
|
207
|
+
end
|
286
208
|
|
287
|
-
|
288
|
-
expect(response.content_type).to eql("application/octet-stream")
|
289
|
-
end
|
209
|
+
context "matching a stub with no content-type" do
|
290
210
|
|
291
|
-
|
292
|
-
|
293
|
-
|
211
|
+
let(:response) { HTTParty.get("#{server_uri}/stub_response_with_file_and_no_content_type") }
|
212
|
+
|
213
|
+
it "responds with a default content type of 'application/octet-stream'" do
|
214
|
+
expect(response.content_type).to eql("application/octet-stream")
|
215
|
+
end
|
294
216
|
|
217
|
+
it "responds with the configured response" do
|
218
|
+
expect(response).to contain_file(HttpStub::Examples::ConfiguratorWithFileResponses::FILE_PATH)
|
295
219
|
end
|
296
220
|
|
297
221
|
end
|