Class: RSpec::Core::Example
- Inherits:
-
Object
- Object
- RSpec::Core::Example
- Defined in:
- lib/appmap/rspec.rb
Class Method Summary collapse
Class Method Details
.new(*arguments, &block) ⇒ Object
289 290 291 292 293 294 295 |
# File 'lib/appmap/rspec.rb', line 289 def self.new(*arguments, &block) warn "Wrapping example_block for #{name}" if AppMap::RSpec::LOG allocate.tap do |obj| arguments[arguments.length - 1] = wrap_example_block(obj, arguments.last) if arguments.last.is_a?(Proc) obj.send :initialize, *arguments, &block end end |
.wrap_example_block(example, fn) ⇒ Object
277 278 279 280 281 282 283 284 285 286 |
# File 'lib/appmap/rspec.rb', line 277 def wrap_example_block(example, fn) proc do AppMap::RSpec.begin_spec example begin instance_exec(&fn) ensure AppMap::RSpec.end_spec example end end end |