Sha256: be26beb96289065478340150ef8b7705d74f6f5e601620baa1af8915bbd3f535

Contents?: true

Size: 778 Bytes

Versions: 5

Compression:

Stored size: 778 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('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

5 entries across 5 versions & 1 rubygems

Version Path
lastfm-1.6.1 spec/method_specs/tag_spec.rb
lastfm-1.6.0 spec/method_specs/tag_spec.rb
lastfm-1.5.1 spec/method_specs/tag_spec.rb
lastfm-1.5.0 spec/method_specs/tag_spec.rb
lastfm-1.4.0 spec/method_specs/tag_spec.rb