Skip to content

Instantly share code, notes, and snippets.

Setup

This gist tests various aspects of syslog from Ruby. In order to do so you have to setup syslog first.

Setting up syslog is system-specific and quite variable because of variations like rsyslogd or syslogd-ng. OSX, for example, uses a custom system logger (the apple system logger) that supports the syslog API, but also adds additional stuff like the 'syslog' command line application.

require 'minitest/mock'
require 'minitest/unit'
require 'date'
MiniTest::Unit.autorun
class TestMailPurge < MiniTest::Unit::TestCase
class MailPurge
def initialize(imap)
@imap = imap
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",