Class: Opal::RSpec::LegacyAsyncExample

Inherits:
RSpec::Core::Example show all
Defined in:
opal/opal/rspec/async/legacy.rb

Instance Method Summary collapse

Methods inherited from RSpec::Core::Example

#assign_generated_description, #core_block_run, #resolve_subject, #run, #run_after_example

Constructor Details

#initialize(example_group_class, description, user_metadata, example_block = nil) ⇒ LegacyAsyncExample

Returns a new instance of LegacyAsyncExample.



40
41
42
43
44
45
46
47
48
# File 'opal/opal/rspec/async/legacy.rb', line 40

def initialize(example_group_class, description, , example_block=nil)
  legacy_promise_ex_block = lambda do |example|
    self.legacy_promise = Promise.new
    instance_exec(example, &example_block)
    self.legacy_promise
  end

  super example_group_class, description, , legacy_promise_ex_block
end