Commit 764a87f 1 parent 1abaef4 commit 764a87f Copy full SHA for 764a87f
File tree 2 files changed +8
-4
lines changed
spec/support/shared/contexts/msf
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -270,10 +270,13 @@ def alert_user
270
270
# Temporarily set the prompt mode to false to ensure that there are not additional lines printed
271
271
# A workaround for the prompting bug spotted in https://github.com/rapid7/metasploit-framework/pull/18761#issuecomment-1916645095
272
272
def without_prompt ( &block )
273
- previous_prompting_value = user_output . prompting
274
- user_output . prompting ( false )
273
+ if user_output
274
+ previous_prompting_value = user_output . prompting?
275
+ user_output . prompting ( false )
276
+ end
277
+
275
278
yield
276
279
ensure
277
- user_output . prompting ( previous_prompting_value )
280
+ user_output . prompting ( previous_prompting_value ) if user_output
278
281
end
279
282
end
Original file line number Diff line number Diff line change 13
13
let ( :driver_output ) do
14
14
instance = double (
15
15
Rex ::Ui ::Text ::Output ,
16
- prompting? : false
16
+ prompting? : false ,
17
+ prompting : false
17
18
)
18
19
19
20
capture_logging ( instance )
You can’t perform that action at this time.
0 commit comments