spec/spotify_spec.rb in spotify-10.0.0 vs spec/spotify_spec.rb in spotify-10.0.1
- old
+ new
@@ -200,7 +200,17 @@
struct[:subscribers].size.must_equal 2
struct[:subscribers][0].read_string.must_equal "a"
struct[:subscribers][1].read_string.must_equal "bb"
proc { struct[:subscribers][2] }.must_raise IndexError
end
+
+
+ it "should not fail given an empty subscribers struct" do
+ subscribers = FFI::MemoryPointer.new(:uint)
+ subscribers.write_uint(0)
+
+ subject = Spotify::Subscribers.new(subscribers)
+ subject[:count].must_equal 0
+ proc { subject[:subscribers] }.must_raise ArgumentError
+ end
end
end