Skip to content

Commit 5550784

Browse files
committed
✅ Split UIDFetchDataTest tests for warnings
Different parts of these test pass or fail on TruffleRuby or JRuby, so I'm splitting them off into their own tests.
1 parent 2179cb4 commit 5550784

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

test/net/imap/test_fetch_data.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,24 @@ def fetch_data_class
3636
assert_equal 22222, data.uid
3737
end
3838

39-
test "#uid warns when differs from UID attribute" do
40-
data = nil
39+
test "#initialize warns when uid differs from attr['UID']" do
4140
assert_warn(/UIDs do not match/i) do
42-
data = Net::IMAP::UIDFetchData.new(22222, "UID" => 54_321)
41+
Net::IMAP::UIDFetchData.new(22222, "UID" => 54_321)
4342
end
43+
end
44+
45+
test "#uid ignores the UID attribute" do
46+
data = EnvUtil.suppress_warning {
47+
Net::IMAP::UIDFetchData.new(22222, "UID" => 54_321)
48+
}
4449
assert_equal 22222, data.uid
4550
end
4651

4752
test "#deconstruct_keys" do
48-
assert_warn(/UIDs do not match/i) do
49-
Net::IMAP::UIDFetchData.new(22222, "UID" => 54_321) => {
50-
uid: 22222
51-
}
52-
end
53+
data = EnvUtil.suppress_warning {
54+
Net::IMAP::UIDFetchData.new(22222, "UID" => 54_321)
55+
}
56+
assert_pattern { data => { uid: 22222 } }
5357
end
5458
end
5559

0 commit comments

Comments
 (0)