Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created October 17, 2008 14:03
Show Gist options
  • Save dchelimsky/17419 to your computer and use it in GitHub Desktop.
Save dchelimsky/17419 to your computer and use it in GitHub Desktop.
require 'spec'
module Spec
module Macros
end
class << self
def define_macros
Spec::Macros.extend Module.new { yield }
end
def define_macro name, &block
define_macros do
self.class.module_eval do
define_method name, &block
end
end
end
end
end
class Spec::Example::ExampleGroup
extend Spec::Macros
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment