Sha256: d795a16bdb0b497c0fc47d1e846c08495879c046de61bc8818080257f51ed883

Contents?: true

Size: 479 Bytes

Versions: 9

Compression:

Stored size: 479 Bytes

Contents

require '../test_helper'

context "Fetch" do
  setup do
    extend Crags::Fetch
  end

  specify "fetch doc should hpricot fetched html" do
    stubs(:fetch_html).with("url").returns("html")
    Hpricot.expects(:parse).with("html").returns("doc")
    fetch_doc("url").should == "doc"
  end

  specify "fetch html should curl a url" do
    curb = stub(:body_str => "uhh")
    Curl::Easy.expects(:perform).with("url").returns(curb)
    fetch_html("url").should == "uhh"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gotascii-crags-1.0.2 test/crags/fetch_test.rb
gotascii-crags-1.1.0 test/crags/fetch_test.rb
gotascii-crags-1.1.1 test/crags/fetch_test.rb
gotascii-crags-1.2.0 test/crags/fetch_test.rb
gotascii-crags-1.2.3 test/crags/fetch_test.rb
gotascii-crags-1.2.4 test/crags/fetch_test.rb
gotascii-crags-1.2.5 test/crags/fetch_test.rb
gotascii-crags-1.2.6 test/crags/fetch_test.rb
gotascii-crags-1.2.7 test/crags/fetch_test.rb