Created
October 17, 2008 14:03
-
-
Save dchelimsky/17419 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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