Sha256: b2b9a51eedf6a65198f3ff4e2b90414d8f1c821f51a909fdf2e3ed69bc06d0f6
Contents?: true
Size: 1.14 KB
Versions: 5
Compression:
Stored size: 1.14 KB
Contents
require 'spotify_to_mp3' module SpotifyToMp3 describe Spotify do before(:each) do @spotify = SpotifyToMp3::Spotify.new end context '#get_track' do it "resolves HTTP URLs" do track = @spotify.get_track('http://open.spotify.com/track/0qgiFuYhYuwtFXEwYakddE') track.name.should == "I Will Survive" track.artist.should == "Cake" end it "resolves Spotify URIs" do track = @spotify.get_track('spotify:track:0qgiFuYhYuwtFXEwYakddE') track.name.should == "I Will Survive" track.artist.should == "Cake" end it "fails on nonexistent URI" do expect { @spotify.get_track('spotify:track:not-found') }.to raise_error end end context "#resolvable_uri?" do it "accepts HTTP URLs" do @spotify.resolvable_uri?('http://open.spotify.com/track/0qgiFuYhYuwtFXEwYakddE').should be_true end it "accepts Spotify URIs" do @spotify.resolvable_uri?('spotify:track:0qgiFuYhYuwtFXEwYakddE').should be_true end it "refuses other URIs" do @spotify.resolvable_uri?('123').should be_false end end end end
Version data entries
5 entries across 5 versions & 1 rubygems