Sha256: bd8ea82b9331c2ad5b1fe48cb193349a074aeb005c4663a3167127a1f95940f1

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'
require 'find'

describe SharpOffice do
  context "given office files, and can be converted" do
    after(:all) do
      Find.find(File.expand_path("spec/fixture/")) do |path|
        File.delete(path) if path =~ /.*\.pdf$/
        File.delete(path) if path =~ /.*\.swf$/
        File.delete(path) if path =~ /.*\.png$/
      end
    end
    it "should convert doc successfully" do
      @response = SharpOffice.process(File.expand_path("spec/fixture/test.doc"))
      @response.should be_converted_successfully
    end

    it "should convert ppt successfully" do
      @response = SharpOffice.process(File.expand_path("spec/fixture/test.ppt"))
      @response.should be_converted_successfully

    end

    it "should convert xls successfully" do
      @response = SharpOffice.process(File.expand_path("spec/fixture/test.xls"))
      @response.should be_converted_successfully
    end
    
    it "should convert docx successfully" do
      @response = SharpOffice.process(File.expand_path("spec/fixture/test.docx"))
      @response.should be_converted_successfully
    end

    it "should convert docx with params successfully" do
      @response = SharpOffice.process(File.expand_path("spec/fixture/test.docx"), {pages: '1-20'})
      @response.should be_converted_successfully
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
sharp_office_bruce-1.0.3 spec/sharp_office_spec.rb
sharp_office_bruce-1.0.2 spec/sharp_office_spec.rb
sharp_office_bruce-1.0.1 spec/sharp_office_spec.rb
sharp_office-1.0.1 spec/sharp_office_spec.rb
sharp_office-1.0.0 spec/sharp_office_spec.rb
sharp_office-0.1.1 spec/sharp_office_spec.rb