Sha256: 28b191d3fb974975b4e3f17f2da475009f438cf9702af979e5fa69fca35362f7

Contents?: true

Size: 303 Bytes

Versions: 8

Compression:

Stored size: 303 Bytes

Contents

class RSpec::Core::Hooks::HookCollection
  def run
    # WAS:
    #   hooks.each { |h| h.run(@example) }
    # NOW:
    hooks.inject(Promise.value(true)) do |previous_hook_promise, next_hook|
      previous_hook_promise.then do
        Promise.value(next_hook.run(@example))
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
opal-rspec-0.8.0 lib-opal/opal/rspec/async/hooks.rb
opal-rspec-0.8.0.alpha3 lib-opal/opal/rspec/async/hooks.rb
opal-rspec-0.8.0.alpha2 lib-opal/opal/rspec/async/hooks.rb
opal-rspec-0.8.0.alpha1 lib-opal/opal/rspec/async/hooks.rb
opal-rspec-0.7.1 lib-opal/opal/rspec/async/hooks.rb
opal-rspec-0.7.0 lib-opal/opal/rspec/async/hooks.rb
opal-rspec-0.7.0.rc.2 lib-opal/opal/rspec/async/hooks.rb
opal-rspec-0.7.0.rc.1 lib-opal/opal/rspec/async/hooks.rb