# File lib/rspec/core/extensions/module_eval_with_args.rb, line 7
        def module_eval_with_args(*args, &block)
          # ruby > 1.8.6
          return module_exec(*args, &block) if respond_to?(:module_exec)

          # If there are no args and the block doesn't expect any, there's no
          # need to fake module_exec with our hack below.
          # Notes:
          #   * lambda { }.arity # => -1
          #   * lambda { || }.arity # => 0
          #   * lambda { |*a| }.arity # -1
          return module_eval(&block) if block.arity < 1 && args.size.zero?

          instance_eval_with_args(*args, &block)

          # The only difference between instance_eval and module_eval is static method defs.
          #   * `def foo` in instance_eval defines a singleton method on the instance
          #   * `def foo` in class/module_eval defines an instance method for the class/module
          # Here we deal with this difference by defining instance methods on the
          # class/module and removing the singleton definitions.
          singleton_class = class << self; self; end
          extract_static_instance_method_defs_from(block).each do |m_name, m_def|
            define_method(m_name, &m_def)
            singleton_class.send(:remove_method, m_name)
          end
        end