Skip to content

Commit a21b9f2

Browse files
committed
✅ ENABLE tests: move to yml
1 parent 3502886 commit a21b9f2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
:tests:
3+
4+
rfc9051_7.2.1_ENABLED_example:
5+
:response: "* ENABLED CONDSTORE QRESYNC\r\n"
6+
:expected: !ruby/struct:Net::IMAP::UntaggedResponse
7+
name: ENABLED
8+
data:
9+
- CONDSTORE
10+
- QRESYNC
11+
:raw_data: "* ENABLED CONDSTORE QRESYNC\r\n"

test/net/imap/test_imap_response_parser.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def teardown
3030
# §7.1: Generic Status Responses (OK, NO, BAD, PREAUTH, BYE, codes, text)
3131
generate_tests_from fixture_file: "resp_text_responses.yml"
3232

33+
# §7.2.1: ENABLED response
34+
generate_tests_from fixture_file: "enabled_responses.yml"
35+
3336
# §7.2.2: CAPABILITY response
3437
generate_tests_from fixture_file: "capability_responses.yml"
3538

@@ -78,14 +81,6 @@ def teardown
7881
# response data, should still use normal tests, below
7982
############################################################################
8083

81-
def test_enable
82-
parser = Net::IMAP::ResponseParser.new
83-
response = parser.parse("* ENABLED SMTPUTF8\r\n")
84-
assert_equal("ENABLED", response.name)
85-
assert_equal(1, response.data.length)
86-
assert_equal("SMTPUTF8", response.data.first)
87-
end
88-
8984
# todo: move this to response data tests file
9085
# it's testing the mapping fn, not the parsing.
9186
def test_uidplus_copyuid__uid_mapping

0 commit comments

Comments
 (0)