module TestConstruct::RSpecIntegration

def test_construct_default_options

def test_construct_default_options
  {
    base_dir:       TestConstruct.tmpdir,
    chdir:          true,
    keep_on_error:  true,
  }
end

def test_construct_enabled?(example)

def test_construct_enabled?(example)
  !!example.metadata[:test_construct]
end

def test_construct_options(example)

- false/missing (disable the construct for this test)
- a Hash of options
- true (for all defaults)
the :test_construct metadata key can be either:
def test_construct_options(example)
  options = test_construct_default_options
  options[:name] = example.full_description
  metadata_options = example.metadata[:test_construct]
  if metadata_options.is_a?(Hash)
    options.merge!(metadata_options)
  end
  options
end