File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ Metrics/CyclomaticComplexity:
50
50
# URISchemes: http, https
51
51
Metrics/LineLength :
52
52
Max : 215
53
-
54
53
# Offense count: 57
55
54
# Configuration parameters: CountComments.
56
55
Metrics/MethodLength :
@@ -60,6 +59,8 @@ Metrics/MethodLength:
60
59
# Configuration parameters: CountComments.
61
60
Metrics/ModuleLength :
62
61
Max : 212
62
+ Exclude :
63
+ - ' spec/grape/dsl/routing_spec.rb'
63
64
64
65
# Offense count: 21
65
66
Metrics/PerceivedComplexity :
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ def mount(mounts, opts = {})
81
81
mounts = { mounts => '/' } unless mounts . respond_to? ( :each_pair )
82
82
mounts . each_pair do |app , path |
83
83
if app . respond_to? ( :mount_instance )
84
- return mount ( app . mount_instance ( configuration : opts [ :with ] || { } ) => path )
84
+ mount ( app . mount_instance ( configuration : opts [ :with ] || { } ) => path )
85
+ next
85
86
end
86
87
in_setting = inheritable_setting
87
88
Original file line number Diff line number Diff line change @@ -70,6 +70,16 @@ class Dummy
70
70
71
71
expect ( app2 . inheritable_setting . to_hash [ :namespace_stackable ] ) . to eq ( mount_path : [ '/app1' , '/app2' ] )
72
72
end
73
+
74
+ it 'mounts multiple routes at once' do
75
+ base_app = Class . new ( Grape ::API )
76
+ app1 = Class . new ( Grape ::API )
77
+ app2 = Class . new ( Grape ::API )
78
+ base_app . mount ( app1 => '/app1' , app2 => '/app2' )
79
+
80
+ expect ( app1 . inheritable_setting . to_hash [ :namespace_stackable ] ) . to eq ( mount_path : [ '/app1' ] )
81
+ expect ( app2 . inheritable_setting . to_hash [ :namespace_stackable ] ) . to eq ( mount_path : [ '/app2' ] )
82
+ end
73
83
end
74
84
75
85
describe '.route' do
You can’t perform that action at this time.
0 commit comments