Sha256: f8e346c1ff09c80c202fee91886db2ef94bb78daa8409bc08d158dc528ae21ed

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

require File.join(File.dirname(__FILE__), "..", "..", "spec_helper.rb")

describe "Feed" do
  before :all do
    FakeWeb.register_uri("http://slashdot.org/index.rdf", :file => File.join(SPEC_DIR, 'supports', 'slashdot.xml'))
    
    Smoke.feed(:slashdot) do
      url "http://slashdot.org/index.rdf"
      url "http://slashdot.org/index.rdf"
      
      emit do
        rename(:link => :url)
      end
    end
  end
  
  
  it "should have been activated" do
    Smoke[:slashdot].should(be_an_instance_of(Smoke::Source::Feed))
  end
  
  it "should be a list of things" do
    Smoke[:slashdot].items.should be_an_instance_of(Array)
  end
  
  it "should respond to url" do
    Smoke[:slashdot].should respond_to(:url)
  end
  
  describe "after dispatch / query" do
    before do
      Smoke[:slashdot].output
    end
    
    it "should accept multiple urls" do
      Smoke[:slashdot].requests.should be_an_instance_of(Array)
    end
    
    it "should hold the url used to query" do
      Smoke[:slashdot].requests.collect{|r| r.uri }.should include("http://slashdot.org/index.rdf")
    end
    
    it "should have renamed url to link" do
      Smoke[:slashdot].output.first.should have_key(:url)
      Smoke[:slashdot].output.first.should_not have_key(:link)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
benschwarz-smoke-0.3.4 spec/smoke/source/feed_spec.rb
benschwarz-smoke-0.3.5 spec/smoke/source/feed_spec.rb
benschwarz-smoke-0.3.6 spec/smoke/source/feed_spec.rb
benschwarz-smoke-0.3.7 spec/smoke/source/feed_spec.rb
benschwarz-smoke-0.3.9 spec/smoke/source/feed_spec.rb