Skip to content

Commit

Permalink
Updates for 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Apr 1, 2010
1 parent d5eebcf commit 04a96ea
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 29 deletions.
1 change: 1 addition & 0 deletions Manifest.txt
Expand Up @@ -105,6 +105,7 @@ test/binary.dat
test/hidden.zip.txt
test/test.ja.rdoc
test/test.ja.txt
test/test.txt
test/test_attribute_manager.rb
test/test_rdoc_any_method.rb
test/test_rdoc_attr.rb
Expand Down
6 changes: 4 additions & 2 deletions lib/rdoc/generator/darkfish.rb
@@ -1,8 +1,10 @@
#!ruby
# vim: noet ts=2 sts=8 sw=2

require 'rubygems'
gem 'rdoc', '>= 2.4' unless ENV['RDOC_TEST'] or defined?($rdoc_rakefile)
unless File.exist? File.expand_path('../.svn', __FILE__) then
require 'rubygems'
gem 'rdoc', '>= 2.4'
end

require 'pp'
require 'pathname'
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/parser.rb
Expand Up @@ -89,7 +89,7 @@ def self.binary?(file)

def self.zip? file
zip_signature = File.read file, 4

zip_signature == "PK\x03\x04" or
zip_signature == "PK\x05\x06" or
zip_signature == "PK\x07\x08"
Expand Down
1 change: 1 addition & 0 deletions test/test.txt
@@ -0,0 +1 @@
test file
2 changes: 1 addition & 1 deletion test/test_rdoc_any_method.rb
@@ -1,4 +1,4 @@
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class RDocAnyMethodTest < XrefTestCase

Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_class_module.rb
@@ -1,4 +1,4 @@
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocClassModule < XrefTestCase

Expand Down
4 changes: 2 additions & 2 deletions test/test_rdoc_code_object.rb
@@ -1,6 +1,6 @@
require 'rubygems'
require 'minitest/unit'
require 'test/xref_test_case'
require 'minitest/autorun'
require File.expand_path '../xref_test_case', __FILE__
require 'rdoc/code_object'

class TestRDocCodeObject < XrefTestCase
Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_constant.rb
@@ -1,4 +1,4 @@
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocConstant < XrefTestCase

Expand Down
4 changes: 2 additions & 2 deletions test/test_rdoc_context.rb
@@ -1,6 +1,6 @@
require 'rubygems'
require 'minitest/unit'
require 'test/xref_test_case'
require 'minitest/autorun'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocContext < XrefTestCase

Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_include.rb
@@ -1,4 +1,4 @@
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocInclude < XrefTestCase

Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_markup_to_html_crossref.rb
Expand Up @@ -3,7 +3,7 @@
require 'rdoc/rdoc'
require 'rdoc/code_objects'
require 'rdoc/markup/to_html_crossref'
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocMarkupToHtmlCrossref < XrefTestCase

Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_normal_class.rb
@@ -1,4 +1,4 @@
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocNormalClass < XrefTestCase

Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_normal_module.rb
@@ -1,4 +1,4 @@
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocNormalModule < XrefTestCase

Expand Down
8 changes: 2 additions & 6 deletions test/test_rdoc_parser.rb
Expand Up @@ -45,13 +45,9 @@ def test_class_binary_eh_marshal
def test_class_can_parse
assert_equal @RP.can_parse(__FILE__), @RP::Ruby

readme_file_name = File.expand_path '../README.txt', __FILE__
readme_file_name = File.expand_path '../test.txt', __FILE__

unless File.exist? readme_file_name then # HACK for tests in trunk :/
readme_file_name = File.expand_path '../../README.txt', __FILE__
end

assert_equal @RP.can_parse(readme_file_name), @RP::Simple
assert_equal @RP::Simple, @RP.can_parse(readme_file_name)

assert_nil @RP.can_parse(@binary_dat)

Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_require.rb
@@ -1,4 +1,4 @@
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocRequire < XrefTestCase

Expand Down
16 changes: 10 additions & 6 deletions test/test_rdoc_ri_paths.rb
Expand Up @@ -6,6 +6,14 @@

class TestRDocRIPaths < MiniTest::Unit::TestCase

def setup
RDoc::RI::Paths.instance_variable_set :@gemdirs, %w[/nonexistent/gemdir]
end

def teardown
RDoc::RI::Paths.instance_variable_set :@gemdirs, nil
end

def test_class_path_nonexistent
path = RDoc::RI::Paths.path true, true, true, true, '/nonexistent'

Expand All @@ -18,9 +26,7 @@ def test_class_raw_path
assert_equal RDoc::RI::Paths::SYSDIR, path.shift
assert_equal RDoc::RI::Paths::SITEDIR, path.shift
assert_equal RDoc::RI::Paths::HOMEDIR, path.shift

refute_empty path
assert_kind_of String, path.first
assert_equal '/nonexistent/gemdir', path.shift
end

def test_class_raw_path_extra_dirs
Expand All @@ -30,9 +36,7 @@ def test_class_raw_path_extra_dirs
assert_equal RDoc::RI::Paths::SYSDIR, path.shift
assert_equal RDoc::RI::Paths::SITEDIR, path.shift
assert_equal RDoc::RI::Paths::HOMEDIR, path.shift

refute_empty path
assert_kind_of String, path.first
assert_equal '/nonexistent/gemdir', path.shift
end

end
Expand Down
2 changes: 1 addition & 1 deletion test/test_rdoc_top_level.rb
@@ -1,6 +1,6 @@
require 'rubygems'
require 'minitest/autorun'
require 'test/xref_test_case'
require File.expand_path '../xref_test_case', __FILE__

class TestRDocTopLevel < XrefTestCase

Expand Down
2 changes: 1 addition & 1 deletion test/xref_test_case.rb
Expand Up @@ -7,7 +7,7 @@
require 'rdoc/options'
require 'rdoc/code_objects'
require 'rdoc/parser/ruby'
require 'test/xref_data'
require File.expand_path '../xref_data', __FILE__

class XrefTestCase < MiniTest::Unit::TestCase

Expand Down

0 comments on commit 04a96ea

Please sign in to comment.