Sha256: 5afda16ccc28503f367cc09a7c9cbdfd01c78f30c09a0c602f182a5b225a7fd0

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

module RapGenius
  describe Annotation, vcr: {cassette_name: "big-sean-annotation"} do

    let(:annotation) { described_class.new(id: "2092393") }
    subject { annotation }

    its(:id)       { should eq "2092393" }
    its(:url)      { should eq "http://rapgenius.com/2092393" }
    its(:song)     { should be_a Song }
    its(:song_url) { should eq "http://rapgenius.com/Big-sean-control-lyrics" }

    describe "#lyric" do
      it "should have the correct lyric" do
        annotation.lyric.should eq "You gon' get this rain like it's May weather,"
      end
    end

    describe "#explanation" do
      it "should have the correct explanation" do
        annotation.explanation.should include "making it rain"
      end
    end

    describe '.find' do
      it "returns a new instance at the specified path" do
        i = described_class.find("foobar")
        i.should be_an Annotation
        i.id.should eq "foobar"
      end
    end

    context "with additional parameters passed into the constructor" do
      let(:annotation) { described_class.new(id: "5678", lyric: "foo") }

      its(:id)    { should eq "5678" }
      its(:lyric) { should eq "foo" }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rapgenius-0.0.3 spec/rapgenius/annotation_spec.rb