Module: Ruptr::Compat::RSpec::ExampleGroupDSL::Meta

Included in:
Ruptr::Compat::RSpec::ExampleGroupDSL
Defined in:
lib/ruptr/rspec/example_group.rb,
lib/ruptr/rspec/example_group.rb,
lib/ruptr/rspec/example_group.rb,
lib/ruptr/rspec/example_group.rb,
lib/ruptr/rspec/example_group.rb

Instance Method Summary collapse

Instance Method Details

#def_example_group_shortcut(name, extra_metadata) ⇒ Object



336
337
338
339
340
341
# File 'lib/ruptr/rspec/example_group.rb', line 336

def def_example_group_shortcut(name, )
  recordable name
  define_method(name) do |label, *args, **opts, &blk|
    (label, (, args, opts).freeze, &blk)
  end
end

#def_example_shortcut(name, extra_metadata) ⇒ Object



290
291
292
293
294
295
# File 'lib/ruptr/rspec/example_group.rb', line 290

def def_example_shortcut(name, )
  recordable name
  define_method(name) do |label = default_example_name, *args, **opts, &blk|
    (label, (, args, opts).freeze, &blk)
  end
end

#def_it_behaves_like_shortcut(shortcut_name, make_label = ->(name) { "it behaves like #{name}" }) ⇒ Object



390
391
392
393
394
395
# File 'lib/ruptr/rspec/example_group.rb', line 390

def def_it_behaves_like_shortcut(shortcut_name, make_label = ->(name) { "it behaves like #{name}" })
  recordable shortcut_name
  define_method(shortcut_name) do |name, *args, **opts, &blk|
    it_behaves_like_with_label(name, make_label.call(name), *args, **opts, &blk)
  end
end

#recordable(method_name) ⇒ Object



279
# File 'lib/ruptr/rspec/example_group.rb', line 279

def recordable(method_name) = SharedContext.record(method_name)