require 'spec_helper' describe RubyTikaApp do before(:each) do @test_file = "#{File.join(File.dirname(__FILE__))}/docs/graph_sampling_simplex11.pdf" end describe "#to_xml" do it "header" do rta = RubyTikaApp.new(@test_file) rta.to_xml[0..37].should == "" end it "middle" do rta = RubyTikaApp.new(@test_file) xml = rta.to_xml xml_size = xml.size / 2 xml[xml_size..(xml_size + 100)].should == "(Section IV). Besides,\nMHRW performs better in well connected graphs than in\nloosely connected graphs" end end describe "#to_html" do it "header" do rta = RubyTikaApp.new(@test_file) rta.to_html[0..42].should == "" end it "middle" do rta = RubyTikaApp.new(@test_file) rta.to_html[1000 ... 1100].should == "rceName\" content=\"graph_sampling_simplex11.pdf\"/>\n