Skip to content

Instantly share code, notes, and snippets.

@zeitan
Created July 24, 2014 15:00
Show Gist options
  • Save zeitan/dc10de416e8991891a3d to your computer and use it in GitHub Desktop.
Save zeitan/dc10de416e8991891a3d to your computer and use it in GitHub Desktop.
module Foo
[:debug, :info, :warn, :error, :fatal].each do |level|
define_method level do |msg|
p 'dummy 1'
end
end
module_function :debug, :info, :warn, :error, :fatal
private
def message(content, log_level)
'dummy2'
end
end
require 'spec_helper'
require 'foo'
include Foo
describe 'Foo' do
it 'raise Exception' do
expect { raise Exception.new }.to raise_exception (Exception)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment