Module: DebugExceptionsJson::RSpec::Hook
- Defined in:
- lib/debug_exceptions_json/rspec/hook.rb
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/debug_exceptions_json/rspec/hook.rb', line 4 def self.included(base) base.instance_eval do after do |example| # For RSpec2 compatibility if ::RSpec::Core::Version::STRING.start_with?("3.") || ::RSpec::Core::Version::STRING.start_with?("2.99") example.[:response] = example.instance_exec { respond_to?(:response) && response } else # RSpec2 passes ExampleGroup::Nested_N nested = example nested.example.[:response] = nested.example.instance_eval { respond_to?(:response) && response } end end end end |