Sha256: 3eefc84e61ffbc65ab5eeb6f09707dad8ed4fb6b76f1702fd5059ebbda32949b

Contents?: true

Size: 740 Bytes

Versions: 1

Compression:

Stored size: 740 Bytes

Contents

require 'spec_helper'

describe Scrapers::Xkcd do
  it {should respond_to :scrape}
  context "scraping" do
    before(:all) do
      @comic = VCR.use_cassette("xkcd") do
        Scrapers::Xkcd.scrape 149
      end
      @expected = {
        :title      => "Sandwich",
        :url        => "http://xkcd.com/149/",
        :img_src    => "http://imgs.xkcd.com/comics/sandwich.png",
        :hover_text => "Proper User Policy apparently means Simon Says.",
        :pubdate    => "2010-02-01"
      }
    end
    it "should retrieve the comic" do
      @comic.should_not be_nil
    end
    it "should be a Hash" do
      @comic.should be_a(Hash)
    end
    it "should return expected" do
      @comic.should eq @expected
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scrapers-0.4.1 spec/scrapers/xkcd_spec.rb