public
Rubygem
Fork of jmhodges/rfeedparser
Description: rFeedParser is a translation of the Universal Feed Parser from Python into Ruby. It has nearly the exact same behavior.
Homepage: http://rfeedparser.rubyforge.org
Clone URL: git://github.com/technomancy/rfeedparser.git
run all tests by default; skip known bad as an option
technomancy (author)
Wed May 07 11:55:01 -0700 2008
commit  f270afb25487d7df0e3ee9ea8cca0b1e0f19b8ee
tree    98c6cb23a8576d397c3c059566fd9c748e8e056c
parent  fadd750e7b66f08bd872472b872878c5e2c7e02d
...
11
12
13
14
15
 
16
17
18
19
20
21
22
23
24
25
 
 
 
 
 
 
26
27
28
29
30
31
32
 
33
34
35
...
40
41
42
 
43
44
45
...
11
12
13
 
 
14
15
16
17
18
19
 
 
 
 
 
20
21
22
23
24
25
26
27
28
29
30
31
 
32
33
34
35
...
40
41
42
43
44
45
46
0
@@ -11,25 +11,25 @@ class XMLTests < Test::Unit::TestCase
0
   # Some tests are known to fail because we're copying the Python
0
   # version's feed suite verbatim, and we have minor implementation
0
   # details that don't constitute brokenness but are still
0
- # different. By default we should skip them to reduce line noise. If
0
- # you want to leave them in, use `rake test all=yes'
0
+ # different. Running `rake test skip=y' will skip these.
0
   #
0
   # Additionally if you want to run a single test, run:
0
   # rake test n=test_tests_wellformed_encoding_x80macroman
0
   #
0
   def self.skip?(name)
0
- return false if ENV['all']
0
- return ENV['n'] != name if ENV['n']
0
-
0
- @to_skip ||= YAML.load(File.open(File.dirname(__FILE__) + '/to_skip.yml'))
0
- @to_skip.include? name
0
+ return true if ENV['n'] and ENV['n'] != name
0
+
0
+ if ENV['skip']
0
+ @to_skip ||= YAML.load(File.open(File.dirname(__FILE__) + '/to_skip.yml'))
0
+ @to_skip.include? name
0
+ end
0
   end
0
 
0
   Dir["#{File.dirname(__FILE__)}/**/*.xml"].each do |xmlfile|
0
     name = "test_#{xmlfile.gsub('./', '').gsub('/','_').sub('.xml','')}"
0
     next if skip?(name)
0
     
0
- XMLTests.send(:define_method, name) do
0
+ define_method(name) do
0
       fp = FeedParser.parse("http://127.0.0.1:#{$PORT}/#{xmlfile}", :compatible => true)
0
       # I should point out that the 'compatible' arg is not necessary,
0
       # but probably will be in the future if we decide to change the default.
0
@@ -40,6 +40,7 @@ class XMLTests < Test::Unit::TestCase
0
   end
0
 end
0
 
0
+# TODO: don't fail if the rfeedparserserver.rb is already running
0
 # Start up the mongrel server and tell it how to send the tests
0
 server = Mongrel::HttpServer.new("0.0.0.0",$PORT)
0
 Mongrel::DirHandler::add_mime_type('.xml','application/xml')

Comments

    No one has commented yet.