class RSpec::Rails::SystemExampleGroup::SuppressRailsScreenshotMetadata

Allows failure screenshot to work whilst not exposing metadata
@private

def [](key)

def [](key)
  if @example_data.key?(key)
    @example_data[key]
  else
    raise_wrong_scope_error
  end
end

def []=(key, value)

def []=(key, value)
  if key == :failure_screenshot_path
    @example_data[key] = value
  else
    raise_wrong_scope_error
  end
end

def initialize

def initialize
  @example_data = {}
end

def method_missing(_name, *_args, &_block)

def method_missing(_name, *_args, &_block)
  raise_wrong_scope_error
end

def raise_wrong_scope_error

def raise_wrong_scope_error
  raise RSpec::Core::ExampleGroup::WrongScopeError,
        "`metadata` is not available from within an example " \
        "(e.g. an `it` block) or from constructs that run in the " \
        "scope of an example (e.g. `before`, `let`, etc). It is " \
        "only available on an example group (e.g. a `describe` or "\
        "`context` block)"
end