Skip to content

Commit b7f4d66

Browse files
committed
🔎 Simplify parser test debugging
1 parent f5ef196 commit b7f4d66

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/net/imap/net_imap_test_helpers.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ def generate_tests_from(fixture_data: nil, fixture_file: nil)
4242
when :parser_assert_equal
4343
response = test.fetch(:response).force_encoding "ASCII-8BIT"
4444
expected = test.fetch(:expected)
45+
debug = test.fetch(:debug, false)
4546

4647
define_method name do
4748
with_debug do
4849
parser = Net::IMAP::ResponseParser.new
4950
actual = parser.parse response
51+
binding.irb if debug
5052
assert_equal expected, actual
5153
end
5254
end
@@ -58,7 +60,9 @@ def generate_tests_from(fixture_data: nil, fixture_file: nil)
5860
with_debug do
5961
parser = Net::IMAP::ResponseParser.new
6062
actual = parser.parse response
61-
puts YAML.dump name => {response: response, expected: actual}
63+
puts YAML.dump "tests" => {
64+
name => {response: response, expected: actual}
65+
}
6266
pend "update tests with expected data..."
6367
end
6468
end

0 commit comments

Comments
 (0)