Sha256: 2d8a01d7e0872ff16b7d98c862044aa73e5a9a520594f09f895092840b8033f9

Contents?: true

Size: 1.15 KB

Versions: 14

Compression:

Stored size: 1.15 KB

Contents

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

describe '#album' do
  before { init_lastfm }

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

  describe '#get_info' do
    it 'should get info' do
      @lastfm.should_receive(:request).with('album.getInfo', {
        :artist => 'Cher', :album => 'Believe'
      }).and_return(make_response('album_get_info'))

      album = @lastfm.album.get_info(:artist => 'Cher', :album => 'Believe')
      album['name'].should == 'Believe'
      album['artist'].should == 'Cher'
      album['id'].should == '2026126'
      album['mbid'].should == '61bf0388-b8a9-48f4-81d1-7eb02706dfb0'
      album['url'].should == 'http://www.last.fm/music/Cher/Believe'
      album['image'].size.should == 5
      album['releasedate'].should == '6 Apr 1999, 00:00'
      album['tracks']['track'].size.should == 10
      album['tracks']['track'][0]['name'].should == 'Believe'
      album['tracks']['track'][0]['duration'].should == '239'
      album['tracks']['track'][0]['url'].should == 'http://www.last.fm/music/Cher/_/Believe'
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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