Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/docx/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def initialize(path_or_io, options = {})

# if path-or_io is string && does not contain a null byte
if (path_or_io.instance_of?(String) && !/\u0000/.match?(path_or_io))
raise Errno::EIO.new('Invalid file format') if !File.extname(path_or_io).eql?('.docx')
@zip = Zip::File.open(path_or_io)
else
@zip = Zip::File.open_buffer(path_or_io)
Expand Down
6 changes: 0 additions & 6 deletions spec/docx/document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
end

context 'When reading a un-supported file' do
it 'should throw file not supported error' do
expect do
Docx::Document.open(@fixtures_path + '/invalid_format.pdf')
end.to raise_error(Errno::EIO, 'Input/output error - Invalid file format')
end

it 'should throw file not found error' do
invalid_path = @fixtures_path + '/invalid_file_path.docx'
expect do
Expand Down
Loading