Skip to content

Instantly share code, notes, and snippets.

@rcreasey
Created September 27, 2011 20:31
Show Gist options
  • Select an option

  • Save rcreasey/1246155 to your computer and use it in GitHub Desktop.

Select an option

Save rcreasey/1246155 to your computer and use it in GitHub Desktop.
class Parser
attr_accessor :logger
def initialize()
@logger = GELF::Notifier.new
end
def log_request( data )
@logger.notify!(:short_message => 'parsing data', :full_message => data.inspect)
end
end
describe Parser do
before(:each) do
@parser = Parser.new
@parser.logger = mock('GELF::Notifier')
end
it 'should log the incoming data to graylog.' do
@parser.log_request('ohai2u!')
@parser.logger.should_receive(:notify!).with({:short_message => 'parsing data', :full_message => 'ohai2u!'})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment