Sha256: 69fa1eb9d5c15ff5a3b81d5a3f8343914b3e62d2e1c7753261248c7f9d34ee9d

Contents?: true

Size: 786 Bytes

Versions: 12

Compression:

Stored size: 786 Bytes

Contents

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

describe '#tag' do
  before { init_lastfm }

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

  describe '#get_top_artists' do
    it 'should get top artists of some tag' do
      @lastfm.should_receive(:request).with('tag.getTopArtists', {
        :tag => 'Disco',
        :limit => nil,
        :page => nil
      }).and_return(make_response('tag_get_top_artists'))

      artists = @lastfm.tag.get_top_artists(:tag => 'Disco')
      artists.size.should == 5
      artists[0]['name'].should == 'Bee Gees'
      artists[0]['url'].should == 'http://www.last.fm/music/Bee+Gees'
      artists[1]['name'].should == 'ABBA'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lastfm-1.15.1 spec/method_specs/tag_spec.rb
lastfm-1.15.0 spec/method_specs/tag_spec.rb
lastfm-1.14.1 spec/method_specs/tag_spec.rb
lastfm-1.14.0 spec/method_specs/tag_spec.rb
lastfm-1.13.1 spec/method_specs/tag_spec.rb
lastfm-1.13.0 spec/method_specs/tag_spec.rb
lastfm-1.12.0 spec/method_specs/tag_spec.rb
lastfm-1.11.0 spec/method_specs/tag_spec.rb
lastfm-1.10.0 spec/method_specs/tag_spec.rb
lastfm-1.9.0 spec/method_specs/tag_spec.rb
lastfm-1.8.0 spec/method_specs/tag_spec.rb
lastfm-1.7.0 spec/method_specs/tag_spec.rb