spec/song_spec.rb in rapgenius-0.0.1 vs spec/song_spec.rb in rapgenius-0.0.2

- old
+ new

@@ -6,10 +6,25 @@ before do RapGenius::Song.any_instance.stubs(:fetch). returns(File.read(File.expand_path("../support/song.html", __FILE__))) end - + + describe ".find" do + subject { described_class.find("Tim-rogers-swag-lyrics") } + + its(:url) { should eq "http://rapgenius.com/Tim-rogers-swag-lyrics"} + + it "should fetch the document to get song's details" do + subject.expects(:fetch).once.returns( + File.read(File.expand_path("../support/annotation.html", __FILE__)) + ) + + subject.title + end + end + + its(:url) { should eq "http://rapgenius.com/foobar" } its(:title) { should eq "Control" } its(:artist) { should eq "Big Sean" } its(:description) { should include "blew up the Internet" } its(:images) { should be_a Array } \ No newline at end of file