Sha256: 860bbb1665b7b04b42292233bf66f7da66965ee639710938b7d82772fded6094
Contents?: true
Size: 1.33 KB
Versions: 1
Compression:
Stored size: 1.33 KB
Contents
#!/usr/bin/env jruby -S spec require File.join(File.dirname(__FILE__), 'spec_helper') require 'jotify' # WARNING: these specs need a valid spotify (premium) account, otherwise they will fail describe "Integration" do before(:all) do @jotify = Jotify.new end after(:all) do @jotify.close rescue nil end describe "searching" do it "should return a result for a search" do result = @jotify.search("artist:Air") result.should be_a(Jotify::Media::Result) result.artists.should_not be_empty most_popular = result.artists.to_a.sort(&Jotify::ByPopularity).first most_popular.name.should == 'Air' result = @jotify.search("album:Moon Safari") result.albums.should_not be_empty most_popular = result.albums.to_a.sort(&Jotify::ByPopularity).first most_popular.name.should == 'Moon Safari' most_popular.artist.name.should == 'Air' end end describe "playlists" do before do @playlists = @jotify.playlists @playlists.should_not be_empty end it "should return name and id, not tracks (GH-3)" do @playlists.each do |pl| pl.name.should_not be_nil pl.tracks.each do |t| t.getId().should_not be_nil t.getTitle().should be_nil end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spotify-api-0.0.7 | spec/integration_spec.rb |