Post AQRTiX7fvLGA3bWMTo by MichaelT@ruby.social
(DIR) More posts by MichaelT@ruby.social
(DIR) Post #AQRTiWW6B3CaB3wLuS by davetron5000@ruby.social
2022-12-09T20:04:54Z
0 likes, 0 repeats
Anyone ever set a global variable in a RSpec test and then use that to conditionally debug stuff in the code under test? Just me?
(DIR) Post #AQRTiX7fvLGA3bWMTo by MichaelT@ruby.social
2022-12-09T20:08:17Z
0 likes, 0 repeats
@davetron5000 I use the --tag argument
(DIR) Post #AQRTiXb69wnNWrHrLE by davetron5000@ruby.social
2022-12-09T20:10:08Z
0 likes, 0 repeats
@MichaelT This is more like if you have a codepath that will be executed multiple times, but only want to e.g. puts debug during one execution, you do:def test_thing some_setup $debug = true call_the_code assert whateverendafter { $debug = false }def call_the_code some_setup some_other_codeenddef some_setup puts "HERE" if $debugend
(DIR) Post #AQRTiY70FKJf7oDL4S by james@ruby.social
2022-12-09T21:07:24Z
0 likes, 0 repeats
@davetron5000 @MichaelT yep, this, all the time