Skip to content

Commit

Permalink
Delete code marked as removable by releasing v5.0.0. (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
ydah committed Jan 23, 2024
1 parent ffac99f commit c147912
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 52 deletions.
2 changes: 0 additions & 2 deletions test/bin/committee_stub_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

def app
options = {}
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = false

@bin.get_app(hyper_schema, options)
end
Expand Down
3 changes: 0 additions & 3 deletions test/middleware/base_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ def app
private

def new_rack_app(options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

Rack::Builder.new {
use Committee::Middleware::RequestValidation, options
run lambda { |_|
Expand Down
3 changes: 0 additions & 3 deletions test/middleware/request_validation_open_api_3_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,6 @@ def new_rack_app(options = {})
end

def new_rack_app_with_lambda(check_lambda, options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

Rack::Builder.new {
use Committee::Middleware::RequestValidation, options
run check_lambda
Expand Down
3 changes: 0 additions & 3 deletions test/middleware/request_validation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,6 @@ def new_rack_app(options = {})


def new_rack_app_with_lambda(check_lambda, options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

Rack::Builder.new {
use Committee::Middleware::RequestValidation, options
run check_lambda
Expand Down
3 changes: 0 additions & 3 deletions test/middleware/response_validation_open_api_3_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,6 @@ def app
private

def new_response_rack(response, headers = {}, options = {}, rack_options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

status = rack_options[:status] || 200
content_type = rack_options[:content_type] || "application/json"
headers = {
Expand Down
11 changes: 0 additions & 11 deletions test/middleware/response_validation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ def app
assert_equal 200, last_response.status
end

# TODO: remove 5.0.0
it "passes through a valid response" do
# will show deprecated message
@app = new_rack_app(JSON.generate([ValidApp]), {}, schema: hyper_schema, strict: true)
get "/apps"
assert_equal 200, last_response.status
end

it "doesn't call error_handler (has a arg) when response is valid" do
called = false
pr = ->(_e) { called = true }
Expand Down Expand Up @@ -173,9 +165,6 @@ def app
private

def new_rack_app(response, headers = {}, options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

headers = {
"Content-Type" => "application/json"
}.merge(headers)
Expand Down
3 changes: 0 additions & 3 deletions test/middleware/stub_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ def new_rack_app(options = {})
response = options.delete(:response)
suppress = options.delete(:suppress)

# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

Rack::Builder.new {
use Committee::Middleware::Stub, options
run lambda { |env|
Expand Down
4 changes: 0 additions & 4 deletions test/schema_validator/hyper_schema/router_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,13 @@
end

def hyper_schema_router(options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil
schema = Committee::Drivers::HyperSchema::Driver.new.parse(hyper_schema_data)
validator_option = Committee::SchemaValidator::Option.new(options, schema, :hyper_schema)

Committee::SchemaValidator::HyperSchema::Router.new(schema, validator_option)
end

def open_api_2_router(options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil
schema = Committee::Drivers::OpenAPI2::Driver.new.parse(open_api_2_data)
validator_option = Committee::SchemaValidator::Option.new(options, schema, :hyper_schema)

Expand Down
7 changes: 1 addition & 6 deletions test/schema_validator/open_api_3/operation_wrapper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
before do
@path = '/validate'
@method = 'post'

# TODO: delete when 5.0.0 released because default value changed
options = {}
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

@validator_option = Committee::SchemaValidator::Option.new(options, open_api_3_schema, :open_api_3)
@validator_option = Committee::SchemaValidator::Option.new({}, open_api_3_schema, :open_api_3)
end

def operation_object
Expand Down
3 changes: 0 additions & 3 deletions test/schema_validator/open_api_3/request_validator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ def app
end

def new_rack_app(options = {})
# TODO: delete when 5.0.0 released because default value changed
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

Rack::Builder.new {
use Committee::Middleware::RequestValidation, options
run lambda { |_|
Expand Down
6 changes: 1 addition & 5 deletions test/schema_validator/open_api_3/response_validator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
@path = '/validate'
@method = 'post'

# TODO: delete when 5.0.0 released because default value changed
options = {}
options[:parse_response_by_content_type] = true if options[:parse_response_by_content_type] == nil

@validator_option = Committee::SchemaValidator::Option.new(options, open_api_3_schema, :open_api_3)
@validator_option = Committee::SchemaValidator::Option.new({}, open_api_3_schema, :open_api_3)
end

it "passes through a valid response" do
Expand Down
3 changes: 0 additions & 3 deletions test/test/methods_new_version_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ def response_data
@committee_schema = nil

@committee_options = {schema: hyper_schema}

# TODO: delete when 5.0.0 released because default value changed
@committee_options[:parse_response_by_content_type] = false
end

describe "#assert_schema_conform" do
Expand Down
3 changes: 0 additions & 3 deletions test/test/methods_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ def response_data
@committee_router = nil
@committee_schema = nil
@committee_options = {}

# TODO: delete when 5.0.0 released because default value changed
@committee_options[:parse_response_by_content_type] = true
end

describe "Hyper-Schema" do
Expand Down

0 comments on commit c147912

Please sign in to comment.