module Meicar
Constants
- TEST_STRING
Public Class Methods
with_fake_virus(&block)
click to toggle source
Instantiates an “infected” file in a temp folder, passes its path, and then deletes it afterwards.
# File lib/meicar.rb, line 8 def self.with_fake_virus(&block) Tempfile.open("eicar_test_virus") do |f| f.write(TEST_STRING) f.close block.call(f.path) end end