File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff 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
5458end
5559
You can’t perform that action at this time.
0 commit comments