summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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