Class: RSpec::Core::Example
Class Method Summary collapse
Class Method Details
.new(*arguments, &block) ⇒ Object
265 266 267 268 269 270 271 |
# File 'lib/appmap/rspec.rb', line 265 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
253 254 255 256 257 258 259 260 261 262 |
# File 'lib/appmap/rspec.rb', line 253 def wrap_example_block(example, fn) proc do AppMap::RSpec.begin_spec example begin instance_exec(example, &fn) ensure AppMap::RSpec.end_spec example, exception: $! end end end |