Module: RSpecOutlines::ExampleGroup

Defined in:
lib/rspec_outlines.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



62
63
64
65
66
67
68
69
70
71
# File 'lib/rspec_outlines.rb', line 62

def method_missing(name, *args)
  outline_binding = example.outline_binding
  if outline_binding && outline_binding.defined?(name)
    args.empty? or
      raise ArgumentError, "wrong number of arguments (#{args.size} for 0)"
    outline_binding[name]
  else
    super
  end
end

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/rspec_outlines.rb', line 5

def self.included(base)
  base.extend ClassMethods
end