Sha256: b298f79a616e7895215747b15183dc0ee71ae378ed59c09841069d007d4151f8

Contents?: true

Size: 645 Bytes

Versions: 12

Compression:

Stored size: 645 Bytes

Contents

require 'spec_helper'

describe GenericFile do

  describe "#virus_check" do
    before do
      unless defined? ClamAV
        class ClamAV
          def self.instance
            new
          end
        end
        @stubbed_clamav = true
      end
    end
    after do
      Object.send(:remove_const, :ClamAV) if @stubbed_clamav
    end
    it "should return the results of running ClamAV scanfile method" do
      # subject.stub(:to_solr).and_return({})
      ClamAV.any_instance.should_receive(:scanfile).and_return(1)    
      Sufia::GenericFile::Actions.virus_check(File.new(fixture_path + '/world.png')).should == 1
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sufia-3.4.0 spec/models/generic_file/actions_spec.rb
sufia-3.4.0.rc4 spec/models/generic_file/actions_spec.rb
sufia-3.4.0.rc3 spec/models/generic_file/actions_spec.rb
sufia-3.3.1 spec/models/generic_file/actions_spec.rb
sufia-3.4.0.rc2 spec/models/generic_file/actions_spec.rb
sufia-3.4.0.rc1 spec/models/generic_file/actions_spec.rb
sufia-3.3.0 spec/models/generic_file/actions_spec.rb
sufia-3.2.1 spec/models/generic_file/actions_spec.rb
sufia-3.1.3 spec/models/generic_file/actions_spec.rb
sufia-3.1.2 spec/models/generic_file/actions_spec.rb
sufia-3.1.1 spec/models/generic_file/actions_spec.rb
sufia-3.1.0 spec/models/generic_file/actions_spec.rb