summaryrefslogtreecommitdiff
path: root/test/rss
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-31 16:10:53 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-31 16:10:53 +0000
commit976226b5de303ed852744c0291c280d1e5fd538f (patch)
tree088915bab077d20c8928cccfca6fb0eb2cf36347 /test/rss
parent35d62eb6a5f6521ed9297d99cb723a2efc85eb19 (diff)
* lib/rss/parser.rb (RSS::Parser): added @@default_parser. Used
XML parser became selectable. * test/rss/test_parser.rb: added tests for RSS::Parser.default_parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss')
-rw-r--r--test/rss/each_parser.rb17
-rw-r--r--test/rss/test.rb16
-rw-r--r--test/rss/test_parser.rb10
3 files changed, 10 insertions, 33 deletions
diff --git a/test/rss/each_parser.rb b/test/rss/each_parser.rb
deleted file mode 100644
index b1ea9c5e11..0000000000
--- a/test/rss/each_parser.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env ruby
-
-require "rbconfig"
-
-c = Config::CONFIG
-ruby = File.join(c['bindir'], c['ruby_install_name'])
-
-module RSS
- AVAILABLE_PARSERS = [ARGV.shift]
-end
-
-def load_test_file(name)
- puts "Loading #{name} ..."
- require name
-end
-
-load_test_file(ARGV.shift)
diff --git a/test/rss/test.rb b/test/rss/test.rb
deleted file mode 100644
index 3b462cc4a3..0000000000
--- a/test/rss/test.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-
-require "rbconfig"
-require "rss/parser"
-
-c = Config::CONFIG
-ruby = File.join(c['bindir'], c['ruby_install_name'])
-
-RSS::AVAILABLE_PARSERS.each do |parser|
- puts "------------------------------------"
- puts "Using #{parser}"
- puts "------------------------------------"
- Dir.glob(ARGV.shift || "test/test_*") do |file|
- puts(`#{ruby} #{if $DEBUG then '-d' end} -I. -I./lib test/each_parser.rb #{parser} #{file} #{ARGV.join(' ')}`)
- end
-end
diff --git a/test/rss/test_parser.rb b/test/rss/test_parser.rb
index 570141315b..cc0263b21a 100644
--- a/test/rss/test_parser.rb
+++ b/test/rss/test_parser.rb
@@ -417,4 +417,14 @@ EOR
end
+ def test_default_parser
+ assert_nothing_raised() do
+ Parser.default_parser = RSS::AVAILABLE_PARSERS.first
+ end
+
+ assert_raise(RSS::NotValidXMLParser) do
+ Parser.default_parser = RSS::Parser
+ end
+ end
+
end