Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.
/ ruby-discid Public archive

Commit 57f885a

Browse files
committed
Fixed call to Disc#toc_string with native implementation
1 parent 3aa7754 commit 57f885a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/discid/disc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def mcn
145145
# @return [String] The TOC string or `nil` if no ID was yet read.
146146
def toc_string
147147
return nil if not @read
148-
result = Lib.get_toc_string
148+
result = Lib.get_toc_string @handle
149149
if not result
150150
# probably an old version of libdiscid (< 0.6.0)
151151
# gather toc string from submission_url

test/test_disc.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,10 @@ def test_put
8585
assert_equal @fiction_lengths, disc.tracks.map{|t| t.sectors}
8686
end
8787

88+
def test_toc_string
89+
disc = DiscId.put(@fiction_first_track, @fiction_sectors, @fiction_offsets)
90+
expected_toc = '1 10 206535 150 18901 39738 59557 79152 100126 124833 147278 166336 182560'
91+
assert_equal expected_toc, disc.toc_string
92+
end
93+
8894
end

0 commit comments

Comments
 (0)