scrobbler-ng 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -3
- data/VERSION.yml +2 -2
- data/lib/scrobbler/artist.rb +8 -3
- data/lib/scrobbler/base.rb +16 -1
- data/lib/scrobbler/helper/image.rb +1 -1
- data/lib/scrobbler/user.rb +33 -2
- data/scrobbler-ng.gemspec +43 -71
- data/tasks/rdoc.rake +2 -1
- data/tasks/tests.rake +3 -21
- metadata +55 -131
- data/test/mocks/library.rb +0 -35
- data/test/mocks/rest.rb +0 -127
- data/test/spec_helper.rb +0 -7
- data/test/test_helper.rb +0 -6
- data/test/unit/album_spec.rb +0 -61
- data/test/unit/artist_spec.rb +0 -132
- data/test/unit/authentication_spec.rb +0 -51
- data/test/unit/event_spec.rb +0 -105
- data/test/unit/geo_spec.rb +0 -148
- data/test/unit/library_spec.rb +0 -133
- data/test/unit/playing_test.rb +0 -53
- data/test/unit/playlist_spec.rb +0 -25
- data/test/unit/radio_spec.rb +0 -22
- data/test/unit/simpleauth_test.rb +0 -45
- data/test/unit/tag_spec.rb +0 -103
- data/test/unit/track_spec.rb +0 -105
- data/test/unit/user_spec.rb +0 -264
- data/test/unit/venue_spec.rb +0 -105
data/test/unit/track_spec.rb
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
|
2
|
-
|
3
|
-
describe Scrobbler::Track do
|
4
|
-
|
5
|
-
before(:all) do
|
6
|
-
@track = Scrobbler::Track.new(Scrobbler::Artist.new(:name => 'Carrie Underwood'), 'Before He Cheats')
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should know the artist' do
|
10
|
-
@track.artist.should be_kind_of(Scrobbler::Artist)
|
11
|
-
@track.artist.name.should eql('Carrie Underwood')
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should know the name' do
|
15
|
-
@track.name.should eql('Before He Cheats')
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should implement all methods from the Last.fm 2.0 API' do
|
19
|
-
@track.should respond_to(:add_tags)
|
20
|
-
@track.should respond_to(:ban)
|
21
|
-
@track.should respond_to(:load_info)
|
22
|
-
@track.should respond_to(:similar)
|
23
|
-
@track.should respond_to(:tags)
|
24
|
-
@track.should respond_to(:top_tags)
|
25
|
-
@track.should respond_to(:top_fans)
|
26
|
-
@track.should respond_to(:love)
|
27
|
-
@track.should respond_to(:remove_tag)
|
28
|
-
@track.should respond_to(:search)
|
29
|
-
@track.should respond_to(:share)
|
30
|
-
Scrobbler::Track.should respond_to(:fingerprint_metadata)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'should be able to add tags'
|
34
|
-
|
35
|
-
it 'should be able to be banned'
|
36
|
-
|
37
|
-
it 'should be able to load more information' do
|
38
|
-
@track.load_info
|
39
|
-
@track.id.should eql(1019817)
|
40
|
-
@track.mbid.should eql('')
|
41
|
-
@track.url.should eql('http://www.last.fm/music/Cher/_/Believe')
|
42
|
-
@track.duration.should eql(222000)
|
43
|
-
@track.streamable.should be_true
|
44
|
-
@track.listeners.should eql(114831)
|
45
|
-
@track.playcount.should eql(435094)
|
46
|
-
@track.artist.should be_kind_of(Scrobbler::Artist)
|
47
|
-
@track.artist.name.should eql('Cher')
|
48
|
-
@track.artist.mbid.should eql('bfcc6d75-a6a5-4bc6-8282-47aec8531818')
|
49
|
-
@track.artist.url.should eql('http://www.last.fm/music/Cher')
|
50
|
-
@track.album.should be_kind_of(Scrobbler::Album)
|
51
|
-
@track.album.position.should eql(1)
|
52
|
-
@track.album.artist.should be_kind_of(Scrobbler::Artist)
|
53
|
-
@track.album.artist.name.should eql('Cher')
|
54
|
-
@track.album.name.should eql('Believe')
|
55
|
-
@track.album.mbid.should eql('61bf0388-b8a9-48f4-81d1-7eb02706dfb0')
|
56
|
-
@track.album.url.should eql('http://www.last.fm/music/Cher/Believe')
|
57
|
-
@track.album.image(:small).should eql('http://userserve-ak.last.fm/serve/64s/8674593.jpg')
|
58
|
-
@track.album.image(:medium).should eql('http://userserve-ak.last.fm/serve/126/8674593.jpg')
|
59
|
-
@track.album.image(:large).should eql('http://userserve-ak.last.fm/serve/174s/8674593.jpg')
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'should be able to get similar tracks'
|
63
|
-
|
64
|
-
it 'should be able to get the user\'s tags'
|
65
|
-
|
66
|
-
it 'should be able to get its top tags' do
|
67
|
-
@track.top_tags.should be_kind_of(Array)
|
68
|
-
@track.top_tags.should have(100).items
|
69
|
-
@track.top_tags.first.should be_kind_of(Scrobbler::Tag)
|
70
|
-
@track.top_tags.first.name.should eql('pop')
|
71
|
-
@track.top_tags.first.count.should eql(924808)
|
72
|
-
@track.top_tags.first.url.should eql('www.last.fm/tag/pop')
|
73
|
-
end
|
74
|
-
|
75
|
-
it 'should be able to get its top fans' do
|
76
|
-
@track.top_fans.should be_kind_of(Array)
|
77
|
-
@track.top_fans.should have(3).items
|
78
|
-
@track.top_fans.first.should be_kind_of(Scrobbler::User)
|
79
|
-
@track.top_fans.first.name.should eql('ccaron0')
|
80
|
-
@track.top_fans.first.url.should eql('http://www.last.fm/user/ccaron0')
|
81
|
-
@track.top_fans.first.image(:small).should eql('')
|
82
|
-
@track.top_fans.first.image(:medium).should eql('')
|
83
|
-
@track.top_fans.first.image(:large).should eql('')
|
84
|
-
@track.top_fans.first.weight.should eql(335873)
|
85
|
-
end
|
86
|
-
|
87
|
-
it 'should be able to love this track'
|
88
|
-
|
89
|
-
it 'should be able to remove a tag'
|
90
|
-
|
91
|
-
it 'should be able to search for a track'
|
92
|
-
|
93
|
-
it 'should be able to share a track'
|
94
|
-
|
95
|
-
it 'should be able to fetch the metadata that matches a certain finderprint' do
|
96
|
-
@metadata = Scrobbler::Track.fingerprint_metadata('1234')
|
97
|
-
@metadata.should have(5).items
|
98
|
-
@track = @metadata[0]
|
99
|
-
@track.rank.should eql 1.0
|
100
|
-
@track.name.should eql 'Merlin\'s Will'
|
101
|
-
@track.artist.name.should eql 'Ayreon'
|
102
|
-
end
|
103
|
-
|
104
|
-
end
|
105
|
-
|
data/test/unit/user_spec.rb
DELETED
@@ -1,264 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
|
2
|
-
|
3
|
-
describe Scrobbler::User do
|
4
|
-
|
5
|
-
before(:all) do
|
6
|
-
@user = Scrobbler::User.new(:name => 'jnunemaker')
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should know its name' do
|
10
|
-
@user.name.should eql('jnunemaker')
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should implement all methods from the Last.fm 2.0 API' do
|
14
|
-
@user.should respond_to(:events)
|
15
|
-
@user.should respond_to(:friends)
|
16
|
-
@user.should respond_to(:load_info)
|
17
|
-
@user.should respond_to(:loved_tracks)
|
18
|
-
@user.should respond_to(:neighbours)
|
19
|
-
@user.should respond_to(:past_events)
|
20
|
-
@user.should respond_to(:playlists)
|
21
|
-
@user.should respond_to(:recent_tracks)
|
22
|
-
@user.should respond_to(:recommended_artists)
|
23
|
-
@user.should respond_to(:recommended_events)
|
24
|
-
@user.should respond_to(:shouts)
|
25
|
-
@user.should respond_to(:top_albums)
|
26
|
-
@user.should respond_to(:top_artists)
|
27
|
-
@user.should respond_to(:top_tags)
|
28
|
-
@user.should respond_to(:top_tracks)
|
29
|
-
@user.should respond_to(:weekly_album_chart)
|
30
|
-
@user.should respond_to(:weekly_artist_chart)
|
31
|
-
@user.should respond_to(:weekly_chart_list)
|
32
|
-
@user.should respond_to(:weekly_track_chart)
|
33
|
-
@user.should respond_to(:shout)
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'should be able to get a list of upcoming events this user is attending' do
|
37
|
-
@user.events.should be_kind_of(Array)
|
38
|
-
@user.events.should have(7).items
|
39
|
-
@user.events.first.should be_kind_of(Scrobbler::Event)
|
40
|
-
@user.events.first.id.should eql(1030003)
|
41
|
-
@user.events.first.title.should eql('The Mars Volta')
|
42
|
-
@user.events.first.headliner.should be_kind_of(Scrobbler::Artist)
|
43
|
-
@user.events.first.headliner.name.should eql('The Mars Volta')
|
44
|
-
@user.events.first.artists.should be_kind_of(Array)
|
45
|
-
@user.events.first.artists.should have(1).items
|
46
|
-
@user.events.first.artists.first.should be_kind_of(Scrobbler::Artist)
|
47
|
-
@user.events.first.artists.first.name.should eql('The Mars Volta')
|
48
|
-
@user.events.first.venue.should be_kind_of(Scrobbler::Venue)
|
49
|
-
@user.events.first.venue.name.should eql('Somerset House')
|
50
|
-
@user.events.first.venue.id.should eql(8796717)
|
51
|
-
@user.events.first.venue.city.should eql('London')
|
52
|
-
@user.events.first.venue.country.should eql('United Kingdom')
|
53
|
-
@user.events.first.venue.street.should eql('Strand')
|
54
|
-
@user.events.first.venue.postalcode.should eql('WC2R 1LA')
|
55
|
-
@user.events.first.venue.geo_lat.should eql('51.510732')
|
56
|
-
@user.events.first.venue.geo_long.should eql('-0.116937')
|
57
|
-
@user.events.first.venue.url.should eql('http://www.last.fm/venue/8796717')
|
58
|
-
@user.events.first.start_date.should eql(Time.mktime(2009, 07, 13, 19, 30, 00))
|
59
|
-
@user.events.first.description.should eql('<div class="bbcode"><a href="http://www.nme.com/news/nme/44079" rel="nofollow">http://www.nme.com/news/nme/44079</a></div>')
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'should be able to get a list of its friends' do
|
63
|
-
@user.friends.should be_kind_of(Array)
|
64
|
-
@user.friends.should have(3).items
|
65
|
-
@user.friends.first.should be_kind_of(Scrobbler::User)
|
66
|
-
@user.friends.first.name.should eql('lobsterclaw')
|
67
|
-
@user.friends.first.realname.should eql('Laura Weiss')
|
68
|
-
@user.friends.first.image(:small).should eql('http://userserve-ak.last.fm/serve/34/1733471.jpg')
|
69
|
-
@user.friends.first.image(:medium).should eql('http://userserve-ak.last.fm/serve/64/1733471.jpg')
|
70
|
-
@user.friends.first.image(:large).should eql('http://userserve-ak.last.fm/serve/126/1733471.jpg')
|
71
|
-
@user.friends.first.url.should eql('http://www.last.fm/user/lobsterclaw')
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'should be able to load additional information'
|
75
|
-
|
76
|
-
it 'should be able to get its loved tracks' do
|
77
|
-
@user.loved_tracks.should be_kind_of(Array)
|
78
|
-
@user.loved_tracks.should have(49).items
|
79
|
-
@user.loved_tracks.first.should be_kind_of(Scrobbler::Track)
|
80
|
-
@user.loved_tracks.first.name.should eql('Early Mornin\' Stoned Pimp')
|
81
|
-
@user.loved_tracks.first.mbid.should eql('')
|
82
|
-
@user.loved_tracks.first.url.should eql('www.last.fm/music/Kid+Rock/_/Early+Mornin%27+Stoned+Pimp')
|
83
|
-
@user.loved_tracks.first.date.should eql(Time.mktime(2009, 4, 28, 11, 38, 0))
|
84
|
-
@user.loved_tracks.first.image(:small).should eql('http://userserve-ak.last.fm/serve/34s/3458313.jpg')
|
85
|
-
@user.loved_tracks.first.image(:medium).should eql('http://userserve-ak.last.fm/serve/64s/3458313.jpg')
|
86
|
-
@user.loved_tracks.first.image(:large).should eql('http://userserve-ak.last.fm/serve/126/3458313.jpg')
|
87
|
-
@user.loved_tracks.first.artist.should be_kind_of(Scrobbler::Artist)
|
88
|
-
@user.loved_tracks.first.artist.name.should eql('Kid Rock')
|
89
|
-
@user.loved_tracks.first.artist.mbid.should eql('ad0ecd8b-805e-406e-82cb-5b00c3a3a29e')
|
90
|
-
@user.loved_tracks.first.artist.url.should eql('http://www.last.fm/music/Kid+Rock')
|
91
|
-
end
|
92
|
-
|
93
|
-
it 'should be able to list the neighbours' do
|
94
|
-
@user.should have(2).neighbours
|
95
|
-
@user.neighbours.first.should be_kind_of(Scrobbler::User)
|
96
|
-
@user.neighbours.first.name.should eql('Driotheri')
|
97
|
-
@user.neighbours.first.url.should eql('http://www.last.fm/user/Driotheri')
|
98
|
-
@user.neighbours.first.match.should eql('0.00027966260677204')
|
99
|
-
@user.neighbours.first.image(:small).should eql('http://userserve-ak.last.fm/serve/34/6070771.jpg')
|
100
|
-
@user.neighbours.first.image(:medium).should eql('http://userserve-ak.last.fm/serve/64/6070771.jpg')
|
101
|
-
@user.neighbours.first.image(:large).should eql('http://userserve-ak.last.fm/serve/126/6070771.jpg')
|
102
|
-
end
|
103
|
-
|
104
|
-
it 'should be able to list the attened events'
|
105
|
-
|
106
|
-
describe 'retrieving a users playlist' do
|
107
|
-
|
108
|
-
before do
|
109
|
-
@playlists = @user.playlists
|
110
|
-
@firstplaylist = @playlists.first
|
111
|
-
end
|
112
|
-
|
113
|
-
it 'should return 4 playlists' do
|
114
|
-
@playlists.size.should eql(4)
|
115
|
-
end
|
116
|
-
|
117
|
-
it 'should have the correct attributes in the first playlist' do
|
118
|
-
#@firstplaylist.id.should eql(5606)
|
119
|
-
require 'pp'
|
120
|
-
pp @firstplaylist.id
|
121
|
-
@firstplaylist.title.should eql('Misc gubbins')
|
122
|
-
@firstplaylist.description.should eql('This is a misc test playlist with a few random tracks in it.')
|
123
|
-
@firstplaylist.date.should eql(Time.mktime(2006, 11, 15, 13, 05, 48))
|
124
|
-
@firstplaylist.size.should eql(10)
|
125
|
-
@firstplaylist.duration.should eql(2771)
|
126
|
-
@firstplaylist.streamable.should be_false
|
127
|
-
@firstplaylist.creator.should eql('http://www.last.fm/user/RJ')
|
128
|
-
@firstplaylist.url.should eql('http://www.last.fm/user/RJ/library/playlists/4bq_misc_gubbins')
|
129
|
-
@firstplaylist.image(:small).should eql('http://userserve-ak.last.fm/serve/34/4218758.jpg')
|
130
|
-
@firstplaylist.image(:medium).should eql('http://userserve-ak.last.fm/serve/64/4218758.jpg')
|
131
|
-
@firstplaylist.image(:large).should eql('http://userserve-ak.last.fm/serve/126/4218758.jpg')
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
|
136
|
-
it 'should be able to fetch the recent tracks' do
|
137
|
-
@user.should have(10).recent_tracks
|
138
|
-
@user.recent_tracks.first.should be_kind_of(Scrobbler::Track)
|
139
|
-
@user.recent_tracks.first.name.should eql('Empty Arms')
|
140
|
-
@user.recent_tracks.first.mbid.should eql('')
|
141
|
-
@user.recent_tracks.first.url.should eql('http://www.last.fm/music/Stevie+Ray+Vaughan/_/Empty+Arms')
|
142
|
-
@user.recent_tracks.first.date.should eql(Time.mktime(2009, 5, 6, 18, 16, 00))
|
143
|
-
@user.recent_tracks.first.now_playing.should be_true
|
144
|
-
@user.recent_tracks.first.streamable.should be_true
|
145
|
-
@user.recent_tracks.first.artist.should be_kind_of(Scrobbler::Artist)
|
146
|
-
@user.recent_tracks.first.artist.name.should eql('Stevie Ray Vaughan')
|
147
|
-
@user.recent_tracks.first.artist.mbid.should eql('f5426431-f490-4678-ad44-a75c71097bb4')
|
148
|
-
@user.recent_tracks.first.album.should be_kind_of(Scrobbler::Album)
|
149
|
-
@user.recent_tracks.first.album.mbid.should eql('dfb4ba34-6d3f-4d88-848f-e8cc1e7c24d7')
|
150
|
-
@user.recent_tracks.first.album.name.should eql('Sout To Soul')
|
151
|
-
@user.recent_tracks.first.image(:small).should eql('http://userserve-ak.last.fm/serve/34s/4289298.jpg')
|
152
|
-
@user.recent_tracks.first.image(:medium).should eql('http://userserve-ak.last.fm/serve/64s/4289298.jpg')
|
153
|
-
@user.recent_tracks.first.image(:large).should eql('http://userserve-ak.last.fm/serve/126/4289298.jpg')
|
154
|
-
end
|
155
|
-
|
156
|
-
it 'should be able to list the recommended artists'
|
157
|
-
|
158
|
-
it 'should be able to list the recommended events'
|
159
|
-
|
160
|
-
it 'should be able to list the shouts'
|
161
|
-
|
162
|
-
it 'should be able to list the top albums' do
|
163
|
-
@user.should have(3).top_albums
|
164
|
-
@user.top_albums.first.should be_kind_of(Scrobbler::Album)
|
165
|
-
@user.top_albums.first.name.should eql('Slave To The Grid')
|
166
|
-
@user.top_albums.first.mbid.should eql('')
|
167
|
-
@user.top_albums.first.playcount.should eql(251)
|
168
|
-
@user.top_albums.first.rank.should eql(1)
|
169
|
-
@user.top_albums.first.artist.should be_kind_of(Scrobbler::Artist)
|
170
|
-
@user.top_albums.first.artist.name.should eql('Skid Row')
|
171
|
-
@user.top_albums.first.artist.mbid.should eql('6da0515e-a27d-449d-84cc-00713c38a140')
|
172
|
-
@user.top_albums.first.url.should eql('http://www.last.fm/music/Skid+Row/Slave+To+The+Grid')
|
173
|
-
@user.top_albums.first.image(:small).should eql('http://userserve-ak.last.fm/serve/34s/12621887.jpg')
|
174
|
-
@user.top_albums.first.image(:medium).should eql('http://userserve-ak.last.fm/serve/64s/12621887.jpg')
|
175
|
-
@user.top_albums.first.image(:large).should eql('http://userserve-ak.last.fm/serve/126/12621887.jpg')
|
176
|
-
end
|
177
|
-
|
178
|
-
it 'should be able to list the top artists' do
|
179
|
-
@user.should have(3).top_artists
|
180
|
-
@user.top_artists.first.should be_kind_of(Scrobbler::Artist)
|
181
|
-
first = @user.top_artists.first
|
182
|
-
first.name.should eql('Dream Theater')
|
183
|
-
first.mbid.should eql('28503ab7-8bf2-4666-a7bd-2644bfc7cb1d')
|
184
|
-
first.playcount.should eql(1643)
|
185
|
-
first.rank.should eql(1)
|
186
|
-
first.url.should eql('http://www.last.fm/music/Dream+Theater')
|
187
|
-
first.image(:small).should eql('http://userserve-ak.last.fm/serve/34/5535004.jpg')
|
188
|
-
first.image(:medium).should eql('http://userserve-ak.last.fm/serve/64/5535004.jpg')
|
189
|
-
first.image(:large).should eql('http://userserve-ak.last.fm/serve/126/5535004.jpg')
|
190
|
-
first.streamable.should be_true
|
191
|
-
end
|
192
|
-
|
193
|
-
it 'should be able to list the top tags' do
|
194
|
-
@user.should have(7).top_tags
|
195
|
-
@user.top_tags.first.should be_kind_of Scrobbler::Tag
|
196
|
-
first = @user.top_tags.first
|
197
|
-
first.name.should eql 'rock'
|
198
|
-
first.count.should eql 16
|
199
|
-
first.url.should eql 'www.last.fm/tag/rock'
|
200
|
-
end
|
201
|
-
|
202
|
-
it 'should be able to list the top tracks' do
|
203
|
-
@user.should have(3).top_tracks
|
204
|
-
@user.top_tracks.first.should be_kind_of(Scrobbler::Track)
|
205
|
-
first = @user.top_tracks.first
|
206
|
-
first.name.should eql 'Learning to Live'
|
207
|
-
first.mbid.should eql ''
|
208
|
-
first.playcount.should eql 51
|
209
|
-
first.rank.should eql 1.0
|
210
|
-
first.url.should eql 'http://www.last.fm/music/Dream+Theater/_/Learning+to+Live'
|
211
|
-
first.image(:small).should eql 'http://userserve-ak.last.fm/serve/34s/12620339.jpg'
|
212
|
-
first.image(:medium).should eql 'http://userserve-ak.last.fm/serve/64s/12620339.jpg'
|
213
|
-
first.image(:large).should eql 'http://userserve-ak.last.fm/serve/126/12620339.jpg'
|
214
|
-
first.artist.should be_kind_of Scrobbler::Artist
|
215
|
-
first.artist.name.should eql 'Dream Theater'
|
216
|
-
first.artist.mbid.should eql '28503ab7-8bf2-4666-a7bd-2644bfc7cb1d'
|
217
|
-
first.artist.url.should eql 'http://www.last.fm/music/Dream+Theater'
|
218
|
-
first.streamable.should be_true
|
219
|
-
end
|
220
|
-
|
221
|
-
it 'should be able to get the weekly album chart' do
|
222
|
-
@user.weekly_album_chart.should have(36).items
|
223
|
-
first = @user.weekly_album_chart.first
|
224
|
-
first.should be_kind_of Scrobbler::Album
|
225
|
-
first.artist.should be_kind_of Scrobbler::Artist
|
226
|
-
first.artist.name.should eql 'Nine Inch Nails'
|
227
|
-
first.artist.mbid.should eql 'b7ffd2af-418f-4be2-bdd1-22f8b48613da'
|
228
|
-
first.mbid.should eql 'df025315-4897-4759-ba77-d2cd09b5b4b6'
|
229
|
-
first.name.should eql 'With Teeth'
|
230
|
-
first.playcount.should eql 13
|
231
|
-
first.rank.should eql 1
|
232
|
-
first.url.should eql 'http://www.last.fm/music/Nine+Inch+Nails/With+Teeth'
|
233
|
-
end
|
234
|
-
|
235
|
-
it 'should be able to get the weekly artist chart' do
|
236
|
-
@user.weekly_artist_chart.should have(36).items
|
237
|
-
first = @user.weekly_artist_chart.first
|
238
|
-
first.should be_kind_of Scrobbler::Artist
|
239
|
-
first.name.should eql 'Nine Inch Nails'
|
240
|
-
first.mbid.should eql 'b7ffd2af-418f-4be2-bdd1-22f8b48613da'
|
241
|
-
first.playcount.should eql 26
|
242
|
-
first.rank.should eql 1
|
243
|
-
first.url.should eql 'http://www.last.fm/music/Nine+Inch+Nails'
|
244
|
-
end
|
245
|
-
|
246
|
-
it 'should be able to get the weekly chart list'
|
247
|
-
|
248
|
-
it 'should be able to get the weekly track chart' do
|
249
|
-
@user.weekly_track_chart.should have(106).items
|
250
|
-
first = @user.weekly_track_chart.first
|
251
|
-
first.should be_kind_of Scrobbler::Track
|
252
|
-
first.name.should eql 'Three Minute Warning'
|
253
|
-
first.artist.should be_kind_of Scrobbler::Artist
|
254
|
-
first.artist.name.should eql 'Liquid Tension Experiment'
|
255
|
-
first.artist.mbid.should eql 'bc641be9-ca36-4c61-9394-5230433f6646'
|
256
|
-
first.mbid.should eql ''
|
257
|
-
first.playcount.should eql 5
|
258
|
-
first.rank.should eql 1.0
|
259
|
-
first.url.should eql 'www.last.fm/music/Liquid+Tension+Experiment/_/Three+Minute+Warning'
|
260
|
-
end
|
261
|
-
|
262
|
-
it 'should be able to leave a shout'
|
263
|
-
|
264
|
-
end
|
data/test/unit/venue_spec.rb
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
|
2
|
-
|
3
|
-
describe Scrobbler::Venue do
|
4
|
-
before do
|
5
|
-
f = File.read(File.dirname(__FILE__) + '/../fixtures/xml/venue/venue.xml')
|
6
|
-
doc = Nokogiri::XML(f)
|
7
|
-
@venue = Scrobbler::Venue.new_from_xml(doc.root)
|
8
|
-
@event_ids = [875740, 950267, 1082373, 1059277]
|
9
|
-
@event_titles = ["Kilians", "Convention of the Universe - International Depeche Mode Fan Event", "The Get Up Kids", "Philipp Poisel"]
|
10
|
-
end
|
11
|
-
|
12
|
-
describe 'should implement the method' do
|
13
|
-
[:events,:past_events].each do |method_name|
|
14
|
-
it "'#{method_name}'" do
|
15
|
-
@venue.should respond_to(method_name)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'search' do
|
20
|
-
Scrobbler::Venue.should respond_to(:search)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe 'a Venue built from XML should have' do
|
25
|
-
it 'an ID' do
|
26
|
-
@venue.id.should eql(9027137)
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'a name' do
|
30
|
-
@venue.name.should eql('Karrera Klub')
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'a city' do
|
34
|
-
@venue.city.should eql('Berlin')
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'a country' do
|
38
|
-
@venue.country.should eql('Germany')
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'a street' do
|
42
|
-
@venue.street.should eql('Neue Promenade 10')
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'a postalcode' do
|
46
|
-
@venue.postalcode.should eql('10178')
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'a geo_lat' do
|
50
|
-
@venue.geo_lat.should eql('52.532019')
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'a geo_long' do
|
54
|
-
@venue.geo_long.should eql('13.427965')
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'a timezone' do
|
58
|
-
@venue.timezone.should eql('CET')
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'a URL' do
|
62
|
-
@venue.url.should eql('http://www.last.fm/venue/9027137')
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
describe 'finding events for Postbahnhof, Berlin' do
|
67
|
-
before do
|
68
|
-
@events = @venue.events
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'should find 4 events' do
|
72
|
-
@events.size.should eql 4
|
73
|
-
end
|
74
|
-
|
75
|
-
it "should have the correct event id's" do
|
76
|
-
@events.collect(&:id).should eql @event_ids
|
77
|
-
end
|
78
|
-
|
79
|
-
it 'should have the correct event titles' do
|
80
|
-
@events.collect(&:title).should eql @event_titles
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
describe 'finding past events for Postbahnhof, Berlin' do
|
85
|
-
before do
|
86
|
-
@events = @venue.past_events
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'should find 4 events' do
|
90
|
-
@events.size.should eql 4
|
91
|
-
end
|
92
|
-
|
93
|
-
it "should have the correct event id's" do
|
94
|
-
@events.collect(&:id).should eql @event_ids
|
95
|
-
end
|
96
|
-
|
97
|
-
it 'should have the correct event titles' do
|
98
|
-
@events.collect(&:title).should eql @event_titles
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
describe 'searching for venues' do
|
103
|
-
#TODO
|
104
|
-
end
|
105
|
-
end
|