Method: RSpec::Core::Configuration#expose_current_running_example_as
- Defined in:
- lib/rspec/core/configuration.rb
#expose_current_running_example_as(method_name) ⇒ void
Exposes the current running example via the named
helper method. RSpec 2.x exposed this via example
,
but in RSpec 3.0, the example is instead exposed via
an arg yielded to it
, before
, let
, etc. However,
some extension gems (such as Capybara) depend on the
RSpec 2.x's example
method, so this config option
can be used to maintain compatibility.
1811 1812 1813 1814 1815 1816 1817 1818 |
# File 'lib/rspec/core/configuration.rb', line 1811 def expose_current_running_example_as(method_name) ExposeCurrentExample.module_exec do extend RSpec::SharedContext let(method_name) { |ex| ex } end include ExposeCurrentExample end |