@@ -186,7 +186,7 @@ def initialize
186
186
context 'when some options are grouped' do
187
187
let ( :group_name ) { 'group_name' }
188
188
let ( :group_description ) { 'Used for example reasons' }
189
- let ( :option_names ) { %w[ RHOSTS SMBUser SMBDomain ] }
189
+ let ( :option_names ) { %w[ DigestAlgorithm RHOSTS SMBUser SMBDomain ] }
190
190
let ( :group ) { Msf ::OptionGroup . new ( name : group_name , description : group_description , option_names : option_names ) }
191
191
let ( :aux_mod_with_grouped_options ) do
192
192
mod = aux_mod_with_set_options . replicant
@@ -297,6 +297,35 @@ def initialize
297
297
TABLE
298
298
end
299
299
end
300
+
301
+ context 'when some options are grouped' do
302
+ let ( :group_name ) { 'group_name' }
303
+ let ( :group_description ) { 'Used for example reasons' }
304
+ let ( :option_names ) { %w[ DigestAlgorithm RHOSTS SMBUser SMBDomain ] }
305
+ let ( :group ) { Msf ::OptionGroup . new ( name : group_name , description : group_description , option_names : option_names ) }
306
+ let ( :aux_mod_with_grouped_options ) do
307
+ mod = aux_mod_with_set_options . replicant
308
+ mod . options . add_group ( group )
309
+ mod
310
+ end
311
+
312
+ it 'should return the grouped options separate to the rest of the options' do
313
+ expect ( described_class . dump_advanced_options ( aux_mod_with_grouped_options , indent_string ) ) . to match_table <<~TABLE
314
+ Name Current Setting Required Description
315
+ ---- --------------- -------- -----------
316
+ VERBOSE false no Enable detailed status messages
317
+ WORKSPACE no Specify the workspace for this module
318
+
319
+
320
+ #{ group_description } :
321
+
322
+ Name Current Setting Required Description
323
+ ---- --------------- -------- -----------
324
+ DigestAlgorithm SHA256 yes The digest algorithm to use (Accepted: SHA1, SHA256)
325
+
326
+ TABLE
327
+ end
328
+ end
300
329
end
301
330
302
331
describe '.dump_evasion_options' do
0 commit comments