Skip to content

Commit 680aec6

Browse files
committed
Updated tests with default initialized types for CTOC and CHAP.
1 parent e2efd07 commit 680aec6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/id3v2_frames_test.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ class TestID3v2Frames < Test::Unit::TestCase
9999
{ id: 'CH2', start_time: 201, end_time: 300 },
100100
{ id: 'CH3', start_time: 301, end_time: 400 }
101101
]
102+
103+
@default_ctoc = TagLib::ID3v2::TableOfContentsFrame.new('Test')
104+
@default_chap = TagLib::ID3v2::ChapterFrame.new('Test', 0, 1, 0xFFFFFFFF, 0xFFFFFFFF)
102105
end
103106

104107
should 'not have a CTOC frame' do
@@ -121,7 +124,7 @@ class TestID3v2Frames < Test::Unit::TestCase
121124
@tag.add_frame(toc)
122125

123126
ctoc_frame_list = @tag.frame_list('CTOC')
124-
assert_equal TagLib::ID3v2::TableOfContentsFrame, ctoc_frame_list.first.class
127+
assert_equal @default_ctoc.class, ctoc_frame_list.first.class
125128
assert_equal 1, ctoc_frame_list.size
126129
assert_equal 'TOC', ctoc_frame_list.first.element_id
127130
assert_equal 3, ctoc_frame_list.first.child_elements.size
@@ -145,7 +148,7 @@ class TestID3v2Frames < Test::Unit::TestCase
145148
end
146149

147150
chap_frame_list = @tag.frame_list('CHAP')
148-
assert_equal TagLib::ID3v2::ChapterFrame, chap_frame_list.first.class
151+
assert_equal @default_chap.class, chap_frame_list.first.class
149152
assert_equal 3, chap_frame_list.size
150153
assert_equal 'CH1', chap_frame_list[0].element_id
151154
assert_equal 'CH2', chap_frame_list[1].element_id

0 commit comments

Comments
 (0)