From 696ebcd8cafece7c0ed6407af9679699a16a5c5a Mon Sep 17 00:00:00 2001 From: drbrain Date: Fri, 30 Nov 2012 01:39:03 +0000 Subject: * lib/rdoc/ri/driver.rb: Relaxed matching for pages to be more user-friendly. * test/rdoc/test_rdoc_ri_driver.rb: Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rdoc/test_rdoc_ri_driver.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test') diff --git a/test/rdoc/test_rdoc_ri_driver.rb b/test/rdoc/test_rdoc_ri_driver.rb index 3f0e667784..37f29fbdfc 100644 --- a/test/rdoc/test_rdoc_ri_driver.rb +++ b/test/rdoc/test_rdoc_ri_driver.rb @@ -747,6 +747,40 @@ Foo::Bar#bother assert_match %r%README\.md%, out end + def test_display_page_ignore_directory + util_store + + other = @store1.add_file 'doc/globals.rdoc' + other.parser = RDoc::Parser::Simple + other.comment = + doc( + head(1, 'globals.rdoc'), + para('Globals go here')) + + @store1.save_page other + + out, = capture_io do + @driver.display_page 'home:globals' + end + + assert_match %r%= globals\.rdoc%, out + end + + def test_display_page_missing + util_store + + out, = capture_io do + @driver.display_page 'home:missing' + end + + out, = capture_io do + @driver.display_page_list @store1 + end + + assert_match %r%= Pages in ~/\.rdoc%, out + assert_match %r%README\.rdoc%, out + end + def test_display_page_list util_store -- cgit v1.2.3