Class: RSpec::Core::ExampleGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/example_group_patch.rb

Overview

Monkey patch RSpec to add the feature method in example groups

Class Method Summary collapse

Class Method Details

.orig_subclassObject



19
# File 'lib/rspec/core/example_group_patch.rb', line 19

alias_method :orig_subclass, :subclass

.subclass(parent, description, *all_args, &example_group_block) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/rspec/core/example_group_patch.rb', line 21

def subclass(parent, description, *all_args, &example_group_block)
  rutabaga = all_args.first.any? { |arg| arg.kind_of?(Hash) && arg[:rutabaga] }

  self.orig_subclass(parent, description, *all_args, &example_group_block).tap do |describe|
    Rutabaga::ExampleGroup::Feature.feature(describe, description, all_args.last) if rutabaga
  end
end