2016-12-16 09:12:16 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe ClamavService do
|
|
|
|
describe '.safe_file?' do
|
|
|
|
let(:path_file) { '/tmp/plop.txt' }
|
|
|
|
|
|
|
|
subject { ClamavService.safe_file? path_file }
|
|
|
|
|
|
|
|
before do
|
2017-08-21 15:23:01 +02:00
|
|
|
client = instance_double("ClamAV::Client", :execute => [ClamAV::SuccessResponse])
|
|
|
|
allow(ClamAV::Client).to receive(:new).and_return(client)
|
2016-12-16 09:12:16 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'change permission of file path' do
|
|
|
|
allow(FileUtils).to receive(:chmod).with(0666, path_file).and_return(true)
|
|
|
|
|
|
|
|
subject
|
|
|
|
end
|
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|