Skip to content

Instantly share code, notes, and snippets.

@zzak
Created March 23, 2013 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zzak/5229455 to your computer and use it in GitHub Desktop.
Save zzak/5229455 to your computer and use it in GitHub Desktop.
1) Failure:
TestRDocGeneratorCustom#test_parse_custom_generator_options [/home/zzak/projects/rdoc/test/test_rdoc_generator_custom.rb:75]:
Expected /^invalid options/ to not match "invalid options: --custom-generator\n(invalid options are ignored)\n".
require 'rdoc/test_case'
class RDoc::Generator::Custom
RDoc::RDoc.add_generator self
attr_accessor :custom_generator
def self.setup_options options
@custom_generator = false
opt = options.option_parser
opt.on("--custom-generator") do |value|
@custom_generator = true
end
end
end
class TestRDocGeneratorCustom < RDoc::TestCase
def setup
super
@options = RDoc::Options.new
@generator = RDoc::Generator::Custom
end
def test_parse_custom_generator_options
out, err = capture_io do
@options.parse %W[--custom-generator]
end
refute_match %r%^invalid options%, err
assert_empty out
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment