From c646121b32e2d8bffc3c5336e3b5cf4869394322 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Thu, 31 Mar 2005 04:44:10 +0000 Subject: [PATCH] Fixed some unit tests --- test/all_tests.rb | 2 +- test/unit/file_yard_test.rb | 12 ++++++++---- test/unit/web_test.rb | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/test/all_tests.rb b/test/all_tests.rb index 0a0f5126..023ee389 100755 --- a/test/all_tests.rb +++ b/test/all_tests.rb @@ -4,6 +4,6 @@ require 'find' test_root = File.dirname(__FILE__) Find.find(test_root) { |path| if File.file?(path) and path =~ /.*_test\.rb$/ - require path[(test_root.size + 1)..-4] + load path end } diff --git a/test/unit/file_yard_test.rb b/test/unit/file_yard_test.rb index ece421ff..43794050 100755 --- a/test/unit/file_yard_test.rb +++ b/test/unit/file_yard_test.rb @@ -47,16 +47,20 @@ class FileYardTest < Test::Unit::TestCase # as Tempfile require 'tempfile' - Tempfile.open('acceptable_file') { |f| f.write(one_kylobyte_string) } + + Tempfile.open('acceptable_file') do |f| + f.write(one_kylobyte_string) assert_nothing_raised { @yard.upload_file('acceptable_file', f) } - } - Tempfile.open('one_byte_too_long') { |f| f.write(one_kylobyte_string + 'a') + end + + Tempfile.open('one_byte_too_long') do |f| + f.write(one_kylobyte_string + 'a') assert_nothing_raised { @yard.upload_file('one_byte_too_long_2', f) } - } + end end def file_path diff --git a/test/unit/web_test.rb b/test/unit/web_test.rb index 811833fe..e550aee6 100755 --- a/test/unit/web_test.rb +++ b/test/unit/web_test.rb @@ -108,9 +108,9 @@ class WebTest < Test::Unit::TestCase assert_equal :textile, web.markup assert_equal '008B26', web.color assert !web.safe_mode - assert_equal {}, web.pages + assert_equal({}, web.pages) assert web.allow_uploads - assert_equal @wiki, web.parent_wiki + assert_equal wiki_stub, web.wiki assert_nil web.additional_style assert !web.published assert !web.brackets_only