|
$ ruby -e 'require "./test/rack/service_api_versioning/accept_content_type_selector_test.rb"' -- -v --seed=1 |
|
|
|
# Running tests with run options -v --seed=1: |
|
|
|
|
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when called with a COMPONENT_DESCRIPTION value that::contains a Base URL that is invalid because::the fully-formed URL was not#test_0001_specified 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when called with a COMPONENT_DESCRIPTION value that::contains a Base URL that is invalid because::the finalising slash (/) is#test_0001_omitted 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::a single content type that::is an exact match for the available version#test_0002_has the correct Content Type 0.00 = E |
|
Error: |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::a single content type that::is an exact match for the available version#test_0002_has the correct Content Type: |
|
InvalidBaseUrlError: Invalidly formatted base URL: http://v2.example.com:9876/foo |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:42:in `rescue in version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:39:in `version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:19:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:15:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:42:in `encoded_data_for' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:33:in `add_component_api_version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:73:in `use_api_version' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:58:in `block (2 levels) in match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:52:in `if_requested_api_version_found' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:57:in `block in match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:46:in `if_component_apis_defined' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:56:in `match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:25:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/test/rack/service_api_versioning/accept_content_type_selector_test.rb:145:in `block (3 levels) in <top (required)>' |
|
|
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::a single content type that::is an exact match for the available version#test_0001_matches the correct Service Base URL 0.00 = E |
|
Error: |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::a single content type that::is an exact match for the available version#test_0001_matches the correct Service Base URL: |
|
InvalidBaseUrlError: Invalidly formatted base URL: http://v2.example.com:9876/foo |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:42:in `rescue in version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:39:in `version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:19:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:15:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:42:in `encoded_data_for' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:33:in `add_component_api_version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:73:in `use_api_version' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:58:in `block (2 levels) in match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:52:in `if_requested_api_version_found' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:57:in `block in match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:46:in `if_component_apis_defined' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:56:in `match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:25:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/test/rack/service_api_versioning/accept_content_type_selector_test.rb:145:in `block (3 levels) in <top (required)>' |
|
|
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::a single content type that::is an exact match for the available version#test_0001_matches the correct content type 0.01 = F |
|
Failure: |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::a single content type that::is an exact match for the available version#test_0001_matches the correct content type [/Users/jeffdickey/src/ruby/rack-service_api_versioning/test/rack/service_api_versioning/accept_content_type_selector_test.rb:283] |
|
Minitest::Assertion: --- expected |
|
+++ actual |
|
@@ -1 +1 @@ |
|
-"http://v2.example.com:9876/foo" |
|
+"http://v2.example.com:9876/" |
|
|
|
|
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::a single content type that::does not match the available API Version::the request is aborted with#test_0001_an HTTP 406 status code 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::a single content type that::does not match the available API Version::the request is aborted with#test_0002_the message body reporting only acceptable content type 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::multiple content types that::does not match the available API Version::the request is aborted with#test_0002_the message body reporting the only acceptable content type 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::multiple content types that::does not match the available API Version::the request is aborted with#test_0001_an HTTP 406 status code 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies no "Accept" header::the request is aborted with#test_0001_an HTTP 406 status code 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies no "Accept" header::the request is aborted with#test_0002_the message body reporting the only acceptable content type 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::multiple content types that::specify varying "q" values that have::multiple content types matching "Accept" header entries::where multiple matches have the same "q" value#test_0001_matches the entry occurring first in the content-type list 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when called with a COMPONENT_DESCRIPTION value that::contains no API Version data::returns a Rack response with#test_0001_the status (first element) as 404 ("Not Found") 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when called with a COMPONENT_DESCRIPTION value that::contains no API Version data::returns a Rack response with#test_0002_the body contains the correct message 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::multiple content types that::do not specify any "q" values that::includes a match for the available API Version#test_0001_has the correct :base_url entry 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::multiple content types that::specify varying "q" values that have::multiple content types matching "Accept" header entries::having different "q" values#test_0001_matches the entry with the highest "q" value 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::multiple content types that::includes a match for the available API Version#test_0001_matches the content type in both header and list 0.00 = E |
|
Error: |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::multiple content types that::includes a match for the available API Version#test_0001_matches the content type in both header and list: |
|
InvalidBaseUrlError: Invalidly formatted base URL: http://v2.example.com:9876/foo |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:42:in `rescue in version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:39:in `version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:19:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/encoded_api_version_data.rb:15:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:42:in `encoded_data_for' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:33:in `add_component_api_version_data' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:73:in `use_api_version' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:58:in `block (2 levels) in match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:52:in `if_requested_api_version_found' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:57:in `block in match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:46:in `if_component_apis_defined' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:56:in `match_request_from_header' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/lib/rack/service_api_versioning/accept_content_type_selector.rb:25:in `call' |
|
/Users/jeffdickey/src/ruby/rack-service_api_versioning/test/rack/service_api_versioning/accept_content_type_selector_test.rb:145:in `block (3 levels) in <top (required)>' |
|
|
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::multiple content types that::specify varying "q" values that have::a single content type matching available API Versions#test_0001_matches the entry which occurs in the content-type list 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies no "Accept" header::the request is aborted with#test_0001_an HTTP 406 status code 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies no "Accept" header::the request is aborted with#test_0002_the message body reporting the only acceptable content type 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::multiple content types that::do not specify any "q" values that::does not match the available API Version::the request is aborted with#test_0001_an HTTP 406 status code 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::where the Target Service has multlple API Versions::when the request supplies an "Accept header" with::multiple content types that::do not specify any "q" values that::does not match the available API Version::the request is aborted with#test_0002_the message body reporting only acceptable content type 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::a single content type that::does not match the available API Version::the request is aborted with#test_0001_an HTTP 406 status code 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when the Target Service has a single API Version::when the request supplies an "Accept header" with::a single content type that::does not match the available API Version::the request is aborted with#test_0002_the message body reporting the only acceptable content type 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when called with a COMPONENT_DESCRIPTION value that::is missing::returns a Rack response with#test_0001_the status (first element) as 400 ("Bad Request") 0.00 = . |
|
Rack::ServiceApiVersioning::AcceptContentTypeSelector::when called with a COMPONENT_DESCRIPTION value that::is missing::returns a Rack response with#test_0002_the body contains the correct message 0.00 = . |
|
|
|
Finished tests in 0.030841s, 843.0395 tests/s, 745.7657 assertions/s. |
|
|
|
|
|
26 tests, 23 assertions, 1 failures, 3 errors, 0 skips |
|
Coverage report generated for MiniTest to /Users/jeffdickey/src/ruby/rack-service_api_versioning/coverage. 206 / 206 LOC (100.0%) covered. |