spec/hallon/album_spec.rb in hallon-0.4.0 vs spec/hallon/album_spec.rb in hallon-0.8.0
- old
+ new
@@ -4,41 +4,46 @@
its(:name) { should eq "Finally Woken" }
its(:year) { should be 2004 }
its(:type) { should be :single }
+ its(:browse) do
+ mock_session do
+ Spotify.should_receive(:albumbrowse_create).exactly(2).times.and_return(mock_albumbrowse)
+ should eq Hallon::AlbumBrowse.new(mock_album)
+ end
+ end
+
it { should be_available }
it { should be_loaded }
describe "artist" do
it "should be nil if there is no artist" do
Spotify.should_receive(:album_artist).and_return(null_pointer)
subject.artist.should be_nil
end
- it "should be an artist if it exists"
+ it "should be an artist if it exists" do
+ subject.artist.should be_a Hallon::Artist
+ end
end
describe "cover" do
- before { Hallon::Session.should_receive(:instance).and_return(session) }
-
it "should be nil if there is no image" do
Spotify.should_receive(:album_cover).and_return(null_pointer)
subject.cover.should be_nil
end
it "should be an image if it exists" do
FFI::MemoryPointer.new(:string, 20) do |ptr|
ptr.write_string(mock_image_id)
Spotify.should_receive(:album_cover).and_return(ptr)
- subject.cover.id.should eq mock_image_hex
+ mock_session { subject.cover.id.should eq mock_image_hex }
end
end
end
describe ".types" do
- it "should not be an empty hash" do
- Hallon::Album.types.should_not be_empty
- end
+ specify { Hallon::Album.types.should_not be_empty }
end
end