summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Hodel <drbrain@segment7.net>2012-02-20 14:37:52 -0800
committerEric Hodel <drbrain@segment7.net>2012-02-20 14:37:52 -0800
commitbf56f1cc4d262a7762ba567c67d340574a2d5523 (patch)
treecb82ce6aa7f924465a2992c8aeae359216d2825d /test
parented984716618b9dc54551e1397462307fdae5b2cf (diff)
downloadhoe-bf56f1cc4d262a7762ba567c67d340574a2d5523.tar.gz
+ .rdoc files are now automatically added to the extra_rdoc_files list.
+ The readme_file and history_file are now automatically guessed from the manifest. This allows "README.rdoc" to be used automatically. [git-p4: depot-paths = "//src/hoe/dev/": change = 7057]
Diffstat (limited to 'test')
-rw-r--r--test/test_hoe.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/test_hoe.rb b/test/test_hoe.rb
index 3697534..d1daa7d 100644
--- a/test/test_hoe.rb
+++ b/test/test_hoe.rb
@@ -141,6 +141,54 @@ class TestHoe < MiniTest::Unit::TestCase
ENV['HOME'] = home
end
+ def test_initialize_intuit
+ Dir.mktmpdir do |path|
+ Dir.chdir path do
+ open 'Manifest.txt', 'w' do |io| # sorted
+ io.puts 'FAQ.rdoc'
+ io.puts 'History.rdoc'
+ io.puts 'README.rdoc'
+ end
+
+ open 'README.rdoc', 'w' do |io| io.puts '= blah' end
+ open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
+
+ hoe = Hoe.spec 'blah' do
+ self.version = '1.0'
+ developer 'nobody', 'nobody@example'
+ end
+
+ assert_equal 'History.rdoc', hoe.history_file
+ assert_equal 'README.rdoc', hoe.readme_file
+ assert_equal %w[FAQ.rdoc History.rdoc README.rdoc],
+ hoe.spec.extra_rdoc_files
+ end
+ end
+ end
+
+ def test_initialize_intuit_ambiguous
+ Dir.mktmpdir do |path|
+ Dir.chdir path do
+ open 'Manifest.txt', 'w' do |io|
+ io.puts 'History.rdoc' # sorted
+ io.puts 'README.ja.rdoc'
+ io.puts 'README.rdoc'
+ end
+
+ open 'README.rdoc', 'w' do |io| io.puts '= blah' end
+ open 'README.ja.rdoc', 'w' do |io| io.puts '= blah' end
+ open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
+
+ hoe = Hoe.spec 'blah' do
+ self.version = '1.0'
+ developer 'nobody', 'nobody@example'
+ end
+
+ assert_equal 'README.ja.rdoc', hoe.readme_file
+ end
+ end
+ end
+
def test_file_read_utf
Tempfile.open 'BOM' do |io|
io.write "\xEF\xBB\xBFBOM"