test/tc_read.rb in zip-container-1.1.0 vs test/tc_read.rb in zip-container-2.0.0
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (c) 2013 The University of Manchester, UK.
+# Copyright (c) 2013, 2014 The University of Manchester, UK.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -35,42 +35,42 @@
class TestRead < Test::Unit::TestCase
# Check that the null file does not verify.
def test_verify_null_file
- assert_raise(Zip::ZipError) do
- ZipContainer::Container.verify!($file_null)
+ assert_raise(ZipContainer::ZipError) do
+ ZipContainer::File.verify!($file_null)
end
- refute(ZipContainer::Container.verify($file_null))
+ refute(ZipContainer::File.verify($file_null))
end
# Check that the empty container file does verify.
def test_verify_empty_container
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
- ZipContainer::Container.verify!($empty)
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::ZipError) do
+ ZipContainer::File.verify!($empty)
end
- assert(ZipContainer::Container.verify($empty))
+ assert(ZipContainer::File.verify($empty))
end
# Check that the empty zip file does not verify.
def test_verify_empty_zip
assert_raise(ZipContainer::MalformedContainerError) do
- ZipContainer::Container.verify!($empty_zip)
+ ZipContainer::File.verify!($empty_zip)
end
- refute(ZipContainer::Container.verify($empty_zip))
+ refute(ZipContainer::File.verify($empty_zip))
end
# Check that a compressed mimetype file is detected.
def test_verify_compressed_mimetype
assert_raise(ZipContainer::MalformedContainerError) do
- ZipContainer::Container.verify!($compressed_mimetype)
+ ZipContainer::File.verify!($compressed_mimetype)
end
- refute(ZipContainer::Container.verify($compressed_mimetype))
+ refute(ZipContainer::File.verify($compressed_mimetype))
end
# Check the raw mimetype bytes
def test_raw_mimetypes
empty_container = File.read($empty)
@@ -81,11 +81,11 @@
end
# Check reading files out of a container file and make sure we don't change
# it.
def test_read_files_from_container
- assert_nothing_raised(ZipContainer::MalformedContainerError, Zip::ZipError) do
- ZipContainer::Container.open($example) do |c|
+ assert_nothing_raised(ZipContainer::MalformedContainerError, ZipContainer::ZipError) do
+ ZipContainer::File.open($example) do |c|
assert(c.on_disk?)
refute(c.in_memory?)
assert(c.file.exists?("greeting.txt"))