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, args, &example_group_block) ⇒ Object



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

def subclass(parent, description, args, &example_group_block)
  self.orig_subclass(parent, description, args, &example_group_block).tap do |describe|

    if args.any? { |arg| arg.kind_of?(Hash) && arg[:rutabaga] }
      Rutabaga::ExampleGroup::Feature.feature(describe, description, args)
    end

  end
end