Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcaaece
commit ad125a2
Showing
8 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
describe "Top Fans", :shared => true do | ||
|
||
it "should have array of users" do | ||
@fans.should have_key('user') | ||
@fans['user'].should be_a_kind_of(Array) | ||
@fans['user'].length.should > 0 | ||
end | ||
|
||
describe "a fan" do | ||
|
||
before(:each) do | ||
@fan = @fans['user'][0] | ||
end | ||
|
||
it "should have a name" do | ||
@fan.should have_key('name') | ||
end | ||
|
||
it "should have a url" do | ||
@fan.should have_key('url') | ||
end | ||
|
||
it "should have a weight" do | ||
@fan.should have_key('weight') | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
require 'rubygems' | ||
require 'spec' | ||
require 'spec/interop/test' | ||
|
||
$: << File.dirname(__FILE__) + "/../../lib/" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require File.dirname(__FILE__) + '/../test_helper.rb' | ||
|
||
describe "top_fans for track Metallica - Blackened" do | ||
|
||
before(:all) do #We only want to hit the webservice once. | ||
@track = Scrobbler2::Track.new "Metallic", "Blackened" | ||
@fans = @track.top_fans | ||
end | ||
|
||
it "should be hash" do | ||
@fans.should be_kind_of Hash | ||
end | ||
|
||
it "should have artist" do | ||
@fans.should have_key('artist') | ||
end | ||
|
||
it "should have track" do | ||
@fans.should have_key('track') | ||
end | ||
|
||
it_should_behave_like "Top Fans" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
require 'rubygems' | ||
require 'spec' | ||
require 'spec/interop/test' | ||
|
||
$: << File.dirname(__FILE__) + "/../../lib/" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters