test/test_rdoc_options.rb in rdoc-3.3 vs test/test_rdoc_options.rb in rdoc-3.4
- old
+ new
@@ -343,19 +343,41 @@
end
def self.op() @op end
end
- RDoc::RDoc::GENERATORS['TestGenerator'] = test_generator
+ RDoc::RDoc::GENERATORS['test'] = test_generator
- @options.setup_generator 'TestGenerator'
+ @options.setup_generator 'test'
assert_equal test_generator, @options.generator
assert_equal [test_generator], @options.generator_options
assert_equal @options, test_generator.op
ensure
- RDoc::RDoc::GENERATORS.delete 'TestGenerator'
+ RDoc::RDoc::GENERATORS.delete 'test'
+ end
+
+ def test_setup_generator_no_option_parser
+ test_generator = Class.new do
+ def self.setup_options op
+ op.option_parser.separator nil
+ @op = op
+ end
+
+ def self.op() @op end
+ end
+
+ RDoc::RDoc::GENERATORS['test'] = test_generator
+
+ @options.setup_generator 'test'
+
+ assert_equal test_generator, @options.generator
+ assert_equal [test_generator], @options.generator_options
+
+ assert_equal @options, test_generator.op
+ ensure
+ RDoc::RDoc::GENERATORS.delete 'test'
end
def test_update_output_dir
assert @options.update_output_dir