Sha256: 452c59d4216fc170188753682f1a3930cea2ba3a6641e6b90e343e017b4d5d49
Contents?: true
Size: 729 Bytes
Versions: 2
Compression:
Stored size: 729 Bytes
Contents
require "aws-sdk-sqs" require "recursive-open-struct" require "ostruct" require "json" class Aws::SQS::QueuePoller @@msg = nil def self.msg=(val) @@msg = val end def poll yield(@@msg) end end describe S3Antivirus::Scan do before(:each) do Aws::SQS::QueuePoller.msg = RecursiveOpenStruct.new(body: body) end # Pretty causal test. Mocked out most of the methods. let(:null) { double(:null).as_null_object } let(:scan) do scan = S3Antivirus::Scan.new allow(scan).to receive(:download_file).and_return(true) allow(scan).to receive(:scan_file) scan end let(:body) { IO.read("spec/fixtures/sqs-event.json") } describe "Scan" do it "run" do scan.run end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
s3-antivirus-0.2.0 | spec/lib/scan_spec.rb |
s3-antivirus-0.1.0 | spec/lib/scan_spec.rb |