about summary refs log tree commit homepage
path: root/test/test_tracklist.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_tracklist.rb')
-rw-r--r--test/test_tracklist.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_tracklist.rb b/test/test_tracklist.rb
index a3c89f6..4d00227 100644
--- a/test/test_tracklist.rb
+++ b/test/test_tracklist.rb
@@ -106,4 +106,16 @@ class TestTracklist < Testcase
     tl.remove_track(1 << 128)
     assert_equal %w(b c e f), list_to_path(tl), "no change"
   end
+
+  def test_max
+    tl = DTAS::Tracklist.new
+    assert_kind_of Integer, tl.add_track('z')
+    assert_kind_of Integer, tl.max
+    tl.max = 1
+    assert_equal false, tl.add_track('y')
+    assert_equal 1, tl.instance_variable_get(:@list).size
+    tl.max = 2
+    assert_kind_of Integer, tl.add_track('y')
+    assert_equal 2, tl.instance_variable_get(:@list).size
+  end
 end