Module: RSpec::Distrib::DelegateToMetadata

Included in:
ExampleGroup, ExampleResult
Defined in:
lib/rspec/distrib/example_group.rb

Overview

Helper to proxy getter methods to metadata attributes.

Instance Method Summary collapse

Instance Method Details

#delegate_to_metadata(*keys) ⇒ Object

Defines methods that fetch attributes from metadata hash

Parameters:

  • keys (Array<String>)


9
10
11
# File 'lib/rspec/distrib/example_group.rb', line 9

def (*keys)
  keys.each { |key| define_method(key) { @metadata[key] } }
end