Sha256: 645a14e184606bfa96f79317bcefc05553cbc87569771e28b1fed1d9164c3389

Contents?: true

Size: 1.16 KB

Versions: 28

Compression:

Stored size: 1.16 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe '#library' do
  before { init_lastfm }

  it 'should return an instance of Lastfm::Library' do
    @lastfm.library.should be_an_instance_of(Lastfm::MethodCategory::Library)
  end

  describe '#get_tracks' do
    it 'should get the tracks\' info' do
      @lastfm.should_receive(:request).with('library.getTracks', {
        :user => 'test',
        :artist => 'foo',
        :album => 'bar',
        :limit => nil,
        :page => nil
      }).and_return(make_response('library_get_tracks'))
      tracks = @lastfm.library.get_tracks(:user => 'test', :artist => 'foo', :album => 'bar')
      tracks[0]['name'].should == 'Learning to Live'
      tracks.size.should == 1
    end
  end

  describe '#get_artists' do
    it 'should get the artists\' info' do
      @lastfm.should_receive(:request).with('library.getArtists', {
        :user => 'test',
        :limit => nil,
        :page => nil
      }).and_return(make_response('library_get_artists'))
      artists = @lastfm.library.get_artists(:user => 'test')
      artists[1]['name'].should == 'Dark Castle'
      artists.size.should == 2
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
lastfm-1.27.3 spec/method_specs/library_spec.rb
lastfm-1.27.2 spec/method_specs/library_spec.rb
lastfm-1.27.1 spec/method_specs/library_spec.rb
lastfm-1.27.0 spec/method_specs/library_spec.rb
lastfm-1.26.0 spec/method_specs/library_spec.rb
lastfm-1.25.0 spec/method_specs/library_spec.rb
lastfm-1.24.0 spec/method_specs/library_spec.rb
lastfm-1.23.0 spec/method_specs/library_spec.rb
lastfm-1.22.0 spec/method_specs/library_spec.rb
lastfm-1.21.0 spec/method_specs/library_spec.rb
lastfm-1.20.1 spec/method_specs/library_spec.rb
lastfm-1.19.1 spec/method_specs/library_spec.rb
lastfm-1.19.0 spec/method_specs/library_spec.rb
lastfm-1.18.0 spec/method_specs/library_spec.rb
lastfm-1.17.0 spec/method_specs/library_spec.rb
lastfm-1.16.0 spec/method_specs/library_spec.rb
lastfm-1.15.1 spec/method_specs/library_spec.rb
lastfm-1.15.0 spec/method_specs/library_spec.rb
lastfm-1.14.1 spec/method_specs/library_spec.rb
lastfm-1.14.0 spec/method_specs/library_spec.rb