spec/libreconv_spec.rb in libreconv-0.8.0 vs spec/libreconv_spec.rb in libreconv-0.8.1
- old
+ new
@@ -1,41 +1,27 @@
# encoding: utf-8
require 'spec_helper'
-require 'webrick'
-
-include WEBrick
describe Libreconv do
before(:all) do
@docx_file = file_path("docx.docx")
@doc_file = file_path("doc.doc")
@pptx_file = file_path("pptx.pptx")
@ppt_file = file_path("ppt.ppt")
@target_path = "/tmp/libreconv"
-
- dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))
- port = 50506
- @url = "http://#{Socket.gethostname}:#{port}"
- @t1 = Thread.new do
- @server = HTTPServer.new(:Port => port, :DocumentRoot => dir, :AccessLog => [], :Logger => WEBrick::Log::new("/dev/null", 7))
- @server.start
- end
+ @url = "http://s3.amazonaws.com/libreconv-test/docx.docx"
end
before(:each) do
FileUtils.mkdir_p @target_path
end
after(:each) do
FileUtils.rm_rf @target_path
end
- after(:all) do
- @t1.exit
- end
-
describe Libreconv::Converter do
describe "#new" do
it "should raise error if soffice command does not exists" do
lambda { Libreconv::Converter.new(@doc_file, "/target", "/Whatever/soffice") }.should raise_error(IOError)
end
@@ -80,12 +66,11 @@
converter.convert
File.file?(target_file).should == true
end
it "should convert a docx to pdf specifying an URL as source" do
- url = "#{@url}/docx.docx"
target_file = "#{@target_path}/docx.pdf"
- converter = Libreconv::Converter.new(url, @target_path)
+ converter = Libreconv::Converter.new(@url, @target_path)
converter.convert
File.file?(target_file).should == true
end
end
\ No newline at end of file