Class: TestProf::BeforeAll::HookEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/test_prof/before_all.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block:, filters: []) ⇒ HookEntry

Returns a new instance of HookEntry.



55
56
57
58
# File 'lib/test_prof/before_all.rb', line 55

def initialize(block:, filters: [])
  @block = block
  @filters = TestProf.rspec? ? ::RSpec::Core::Metadata.build_hash_from(filters) : filters
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



53
54
55
# File 'lib/test_prof/before_all.rb', line 53

def block
  @block
end

#filtersObject (readonly)

Returns the value of attribute filters.



53
54
55
# File 'lib/test_prof/before_all.rb', line 53

def filters
  @filters
end

Instance Method Details

#run(scope, metadata) ⇒ Object



60
61
62
63
64
# File 'lib/test_prof/before_all.rb', line 60

def run(scope, )
  return unless filters_apply?()

  block.call(scope)
end