test/specs/yomu.rb in yomu-0.1.5 vs test/specs/yomu.rb in yomu-0.1.6
- old
+ new
@@ -1,9 +1,9 @@
require_relative '../helper.rb'
describe Yomu do
- let(:data) { File.read 'test/samples/sample.pages' }
+ let(:data) { File.read 'test/samples/sample.docx' }
before do
ENV['JAVA_HOME'] = nil
end
@@ -15,10 +15,24 @@
end
it 'reads metadata' do
metadata = Yomu.read :metadata, data
- assert_equal 'application/vnd.apple.pages', metadata['Content-Type']
+ assert_equal 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', metadata['Content-Type']
+ end
+
+ it 'accepts metadata with colon' do
+ doc = File.read 'test/samples/enclosure_problem.doc'
+ metadata = Yomu.read :metadata, doc
+
+ assert_equal 'problem: test', metadata['dc:title']
+ end
+
+ it 'reads mimetype' do
+ mimetype = Yomu.read :mimetype, data
+
+ assert_equal 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', mimetype.content_type
+ assert_includes mimetype.extensions, 'docx'
end
end
describe '.new' do
it 'requires parameters' do