Fixed some unit tests

This commit is contained in:
Alexey Verkhovsky 2005-03-31 04:44:10 +00:00
parent 0dabfca465
commit c646121b32
3 changed files with 11 additions and 7 deletions

View file

@ -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
}

View file

@ -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

View file

@ -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