spec/support/common_objects.rb in hallon-0.14.0 vs spec/support/common_objects.rb in hallon-0.15.0
- old
+ new
@@ -11,18 +11,23 @@
let(:mock_image) { Spotify.mock_image!(mock_image_id, :jpeg, File.size(fixture_image_path), File.read(fixture_image_path), :ok) }
let(:mock_image_id_pointer) { FFI::MemoryPointer.from_string(mock_image_id) }
let(:mock_track) do
artists = pointer_array_with(mock_artist, mock_artist_two)
- Spotify.mock_track!("They", artists.length, artists, mock_album, 123_456, 42, 2, 7, 0, true, :available, :done, false, true, true, false)
+ Spotify.mock_track!("They", artists.length, artists, mock_album, 123_456, 42, 2, 7, :ok, true, :available, :done, false, true, nil, true, false)
end
let(:mock_track_two) do
artists = pointer_array_with(mock_artist)
- Spotify.mock_track!("Amazing", artists.length, artists, mock_album, 123_456, 42, 2, 7, 0, true, :available, :no, false, true, true, true)
+ Spotify.mock_track!("Amazing", artists.length, artists, mock_album, 123_456, 42, 2, 7, :ok, true, :available, :no, false, true, nil, true, true)
end
+ let(:mock_linked_track) do
+ artists = pointer_array_with(mock_artist_two)
+ Spotify.mock_track!("They", artists.length, artists, mock_album, 60, 100, 1, 1, :ok, true, :available, :no, false, true, mock_track, false, false)
+ end
+
let(:mock_albumbrowse) do
copyrights = %w[Kim Elin].map { |x| FFI::MemoryPointer.from_string(x) }
copyrights = pointer_array_with(*copyrights)
tracks = pointer_array_with(mock_track, mock_track_two)
review = "This album is AWESOME"
@@ -32,27 +37,29 @@
let(:mock_artistbrowse) do
similar_artists = pointer_array_with(mock_artist, mock_artist_two)
portraits = pointer_array_with(mock_image_id_pointer, mock_image_id_pointer)
tracks = pointer_array_with(mock_track, mock_track_two)
albums = pointer_array_with(mock_album)
+ tophits = pointer_array_with(mock_track)
- Spotify.mock_artistbrowse(:ok, 2751, mock_artist, portraits.length, portraits, tracks.length, tracks, albums.length, albums, similar_artists.length, similar_artists, "grew up in DA BLOCK", :full, nil, nil)
+ Spotify.mock_artistbrowse(:ok, 2751, mock_artist, portraits.length, portraits, tracks.length, tracks, albums.length, albums, similar_artists.length, similar_artists, tophits.length, tophits, "grew up in DA BLOCK", :full, nil, nil)
end
let(:mock_toplistbrowse) do
artists = pointer_array_with(mock_artist, mock_artist_two)
albums = pointer_array_with(mock_album)
tracks = pointer_array_with(mock_track, mock_track_two)
Spotify.mock_toplistbrowse(:ok, 2751, artists.length, artists, albums.length, albums, tracks.length, tracks)
end
let(:mock_search) do
- artists = pointer_array_with(mock_artist, mock_artist_two)
- albums = pointer_array_with(mock_album)
- tracks = pointer_array_with(mock_track, mock_track_two)
+ artists = pointer_array_with(mock_artist, mock_artist_two)
+ albums = pointer_array_with(mock_album)
+ tracks = pointer_array_with(mock_track, mock_track_two)
+ playlists = pointer_array_with(mock_playlist, mock_playlist_two)
- Spotify.mock_search(:ok, "my query", "another thing", 1337, tracks.length, tracks, 42, albums.length, albums, 81104, artists.length, artists, nil, nil)
+ Spotify.mock_search(:ok, "my å utf8 query", "another thing", 1337, tracks.length, tracks, 42, albums.length, albums, 81104, artists.length, artists, 0716, playlists.length, playlists, nil, nil)
end
let(:mock_subscribers) do
people = %w[Kim Elin Ylva]
people.map! { |x| FFI::MemoryPointer.from_string(x) }
@@ -108,12 +115,12 @@
let(:mock_playlist_raw) do
FFI::Pointer.new(mock_playlist.address)
end
let(:mock_image_uri) { "spotify:image:#{mock_image_hex}" }
- let(:mock_image_hex) { "3ad93423add99766e02d563605c6e76ed2b0e450" }
- let(:mock_image_id) { ":\xD94#\xAD\xD9\x97f\xE0-V6\x05\xC6\xE7n\xD2\xB0\xE4P".force_encoding("BINARY") }
+ let(:mock_image_hex) { "3ad93423add99766e02d563605c6e76ed2b0e400" }
+ let(:mock_image_id) { ":\xD94#\xAD\xD9\x97f\xE0-V6\x05\xC6\xE7n\xD2\xB0\xE4\0".force_encoding("BINARY") }
let(:null_pointer) { FFI::Pointer.new(0) }
let(:a_pointer) { FFI::Pointer.new(1) }
let(:mock_offline_sync_status) do
sync = Spotify::OfflineSyncStatus.new
@@ -155,11 +162,11 @@
Spotify.link_create_from_string!("spotify:image:ce9da340323614dc95ae96b68843b1c726dc5c8a")
end
let(:mock_container) do
num_items = 4
- items_ptr = FFI::MemoryPointer.new(Spotify::Mock::PlaylistTrack, num_items)
+ items_ptr = FFI::MemoryPointer.new(Spotify::Mock::PlaylistContainerItem, num_items)
items = num_items.times.map do |i|
Spotify::Mock::PlaylistContainerItem.new(items_ptr + Spotify::Mock::PlaylistContainerItem.size * i)
end
items[0][:playlist] = mock_playlist
@@ -190,9 +197,10 @@
Spotify.registry_add 'spotify:album:1xvnWMz2PNFf7mXOSRuLws', mock_album
Spotify.registry_add 'spotify:track:7N2Vc8u56VGA4KUrGbikC2', mock_track
Spotify.registry_add 'spotify:user:burgestrand', mock_user
Spotify.registry_add 'spotify:user:burgestrand:playlist:07AX9IY9Hqmj1RqltcG0fi', mock_playlist
Spotify.registry_add 'spotify:user:burgestrand:starred', mock_playlist
+ Spotify.registry_add 'spotify:search:my+%C3%A5+utf8+%EF%A3%BF+query', mock_search
end
config.after do
Spotify.registry_clean
end