Flowdock
method

instance_exec

Importance_0
RSpec latest stable (1.3.1) - 0 notes - Class: Object

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (1.2.8) is shown here.

These similar methods exist in 1.3.1:

instance_exec(*args, &block) public

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File lib/spec/matchers/extensions/instance_exec.rb, line 7
    def instance_exec(*args, &block)
      begin
        orig_critical, Thread.critical = Thread.critical, true
        n = 0
        n += 1 while respond_to?(method_name="__instance_exec#{n}")
        InstanceExecHelper.module_eval{ define_method(method_name, &block) }
      ensure
        Thread.critical = orig_critical
      end
      begin
        return send(method_name, *args)
      ensure
        InstanceExecHelper.module_eval{ remove_method(method_name) } rescue nil
      end
    end
Register or log in to add new notes.