@@ -288,6 +288,66 @@ def foo
288288 RBS
289289 end
290290
291+ def test_translate_of_multiline_sig
292+ contents = <<~RB
293+ sig do
294+ params(
295+ merchandise_lines: T::Array[CheckoutPlatform::PurchaseOrderTerms::Merchandise::MerchandiseLine],
296+ destination_address: T.nilable(Web::Delivery::SimpleStreetDeliveryAddress),
297+ delivery_strategy: T.nilable(Web::Delivery::ConcreteDeliveryStrategy),
298+ delivery_option: T.nilable(::Delivery::Option),
299+ total_cost: T.nilable(MultiCurrency::MoneyBag),
300+ origin_location_id: ::Delivery::OriginLocationId,
301+ estimated_delivery_time_range: T.nilable(T::Array[Time]),
302+ fulfillment_constraints: T.nilable(::OrderRouting::FulfillmentConstraints::Constraints),
303+ auto_fulfillment_override: T.nilable(T::Boolean),
304+ available_on: T.nilable(CheckoutPlatform::Terms::TermConditions::DeliveryLine::AvailableOn)
305+ ).returns(T.self_type)
306+ end
307+ def with_delivery(
308+ merchandise_lines: @merchandise.lines,
309+ destination_address: nil,
310+ delivery_strategy: nil,
311+ delivery_option: nil,
312+ total_cost: nil,
313+ origin_location_id: ::Delivery::OriginLocationId.new(1),
314+ estimated_delivery_time_range: nil,
315+ fulfillment_constraints: nil,
316+ auto_fulfillment_override: nil,
317+ available_on: nil
318+ )
319+ end
320+ RB
321+
322+ assert_equal ( <<~RBS , sorbet_sigs_to_rbs_comments ( contents ) )
323+ #: (
324+ #| ?merchandise_lines: Array[CheckoutPlatform::PurchaseOrderTerms::Merchandise::MerchandiseLine],
325+ #| ?destination_address: Web::Delivery::SimpleStreetDeliveryAddress?,
326+ #| ?delivery_strategy: Web::Delivery::ConcreteDeliveryStrategy?,
327+ #| ?delivery_option: ::Delivery::Option?,
328+ #| ?total_cost: MultiCurrency::MoneyBag?,
329+ #| ?origin_location_id: ::Delivery::OriginLocationId,
330+ #| ?estimated_delivery_time_range: Array[Time]?,
331+ #| ?fulfillment_constraints: ::OrderRouting::FulfillmentConstraints::Constraints?,
332+ #| ?auto_fulfillment_override: bool?,
333+ #| ?available_on: CheckoutPlatform::Terms::TermConditions::DeliveryLine::AvailableOn?
334+ #| ) -> self
335+ def with_delivery(
336+ merchandise_lines: @merchandise.lines,
337+ destination_address: nil,
338+ delivery_strategy: nil,
339+ delivery_option: nil,
340+ total_cost: nil,
341+ origin_location_id: ::Delivery::OriginLocationId.new(1),
342+ estimated_delivery_time_range: nil,
343+ fulfillment_constraints: nil,
344+ auto_fulfillment_override: nil,
345+ available_on: nil
346+ )
347+ end
348+ RBS
349+ end
350+
291351 private
292352
293353 #: (String, ?positional_names: bool) -> String
0 commit comments