File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
lib/selenium/webdriver/common
spec/unit/selenium/webdriver/chrome Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,9 @@ def generate_as_json(value, camelize_keys: true)
137
137
value . each_with_object ( { } ) do |( key , val ) , hash |
138
138
next if val . respond_to? ( :empty? ) && val . empty?
139
139
140
- key = convert_json_key ( key , camelize : camelize_keys )
141
- hash [ key ] = generate_as_json ( val , camelize_keys : camelize? ( key ) )
140
+ camelize = camelize_keys ? camelize? ( key ) : false
141
+ key = convert_json_key ( key , camelize : camelize )
142
+ hash [ key ] = generate_as_json ( val , camelize_keys : camelize )
142
143
end
143
144
elsif value . respond_to? ( :as_json )
144
145
value . as_json
Original file line number Diff line number Diff line change @@ -234,7 +234,8 @@ module Chrome
234
234
set_window_rect : false ,
235
235
args : %w[ foo bar ] ,
236
236
prefs : { foo : 'bar' ,
237
- key_that_should_not_be_camelcased : 'baz' } ,
237
+ key_that_should_not_be_camelcased : 'baz' ,
238
+ nested_one : { nested_two : 'bazbar' } } ,
238
239
binary : '/foo/bar' ,
239
240
extensions : [ 'foo.crx' , 'bar.crx' ] ,
240
241
encoded_extensions : [ 'encoded_foobar' ] ,
@@ -262,7 +263,8 @@ module Chrome
262
263
'setWindowRect' => false ,
263
264
key => { 'args' => %w[ foo bar ] ,
264
265
'prefs' => { 'foo' => 'bar' ,
265
- 'key_that_should_not_be_camelcased' => 'baz' } ,
266
+ 'key_that_should_not_be_camelcased' => 'baz' ,
267
+ 'nested_one' => { 'nested_two' => 'bazbar' } } ,
266
268
'binary' => '/foo/bar' ,
267
269
'extensions' => %w[ encoded_foobar encoded_foo encoded_bar ] ,
268
270
'foo' => 'bar' ,
You can’t perform that action at this time.
0 commit comments