Sha256: 10e7430b10e1c0c0dc38c5ecfeeac17d1eff6f10d458426420c8e1a1b181d7e7

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'

class AtomAutoDiscoveryTest < Test::Unit::TestCase
	def test_autodisc
		base_url = "http://diveintomark.org/tests/client/autodiscovery/"
		url = base_url + "html4-001.html"

		i = 1
		puts "trying now with #{url}"
		while(i)
			puts
			i = 0 # unless otherwise found

			f = Feedbag.find url

			assert_instance_of Array, f
			f.size.should == 1, "Feedbag didn't find a feed on #{url} or found more than one"

			puts " found #{f[0]}"
			feed = Hpricot(open(f[0]))
	
			(feed/"link").each do |l|
				next unless l["rel"] == "alternate"
				url.should == l["href"]
			end

			# ahora me voy al siguiente
			html = Hpricot(open(url))
			(html/"link").each do |l|
				next unless l["rel"] == "next"
				url = URI.parse(base_url).merge(l["href"]).to_s
				puts "trying now with #{url}"
				i = 1
			end
		
		end	
	end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
muck-feedbag-0.7.1 test/atom_autodiscovery_test.rb