test/test_hoe.rb in hoe-3.18.1 vs test/test_hoe.rb in hoe-3.19.0

- old
+ new

@@ -144,19 +144,14 @@ 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 + File.write "Manifest.txt", "FAQ.rdoc\nHistory.rdoc\nREADME.rdoc\n" + File.write "README.rdoc", "= blah\n\nhome :: http://blah/" + File.write "History.rdoc", "=== 1.0" - open "README.rdoc", "w" do |io| io.puts "= blah" end - open "History.rdoc", "w" do |io| io.puts "=== 1.0" 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 @@ -164,20 +159,15 @@ 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 + File.write "Manifest.txt", "History.rdoc\nREADME.ja.rdoc\nREADME.rdoc\n" + File.write "README.rdoc", "= blah\n\nhome :: http://blah/" + File.write "README.ja.rdoc", "= blah\n\nhome :: http://blah/" + File.write "History.rdoc", "=== 1.0" - 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 - assert_equal "README.ja.rdoc", hoe(:skip_files).readme_file end end end @@ -199,16 +189,16 @@ ary = ["* https://github.com/seattlerb/hoe", "* http://docs.seattlerb.org/hoe/", "* http://docs.seattlerb.org/hoe/Hoe.pdf", "* http://github.com/jbarnette/hoe-plugin-examples"].join "\n" - exp = ["https://github.com/seattlerb/hoe", - "http://docs.seattlerb.org/hoe/", - "http://docs.seattlerb.org/hoe/Hoe.pdf", - "http://github.com/jbarnette/hoe-plugin-examples"] + exp = { "home" => "https://github.com/seattlerb/hoe" } + err = /DEPRECATED: Please switch readme to hash format/ - assert_equal exp, hoe.parse_urls(ary) + assert_output "", err do + assert_equal exp, hoe.parse_urls(ary) + end end def test_parse_urls_hash hash = [ "home :: https://github.com/seattlerb/hoe", @@ -242,10 +232,11 @@ "home" => "http://www.zenspider.com/projects/hoe.html", "code" => "https://github.com/seattlerb/hoe", "bugs" => "https://github.com/seattlerb/hoe/issues", "rdoc" => "http://docs.seattlerb.org/hoe/", "doco" => "http://docs.seattlerb.org/hoe/Hoe.pdf", + "clog" => "https://github.com/seattlerb/hoe/blob/master/History.rdoc", "other" => "http://github.com/jbarnette/hoe-plugin-examples", } assert_equal urls, hoe.urls @@ -270,14 +261,15 @@ deps = spec.dependencies.sort_by(&:name) expected = [ ["hoe", :development, "~> #{Hoe::VERSION.sub(/\.\d+$/, "")}"], - ["rdoc", :development, ">= 4.0, < 7"], + ["rdoc", :development, "< 7", ">= 4.0"], ] assert_equal expected, deps.map { |dep| - [dep.name, dep.type, dep.requirement.to_s] + dep_reqs = dep.requirement.to_s.split(/, /).sort + [dep.name, dep.type, *dep_reqs] } end def test_no_license out, err = capture_io do