Class: Spec::Example::SharedExampleGroup

Inherits:
Module show all
Extended by:
ClassMethods
Includes:
ExampleGroupMethods
Defined in:
lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary

Attributes included from ExampleGroupMethods

#description_options, #description_text, #spec_path

Instance Method Summary collapse

Methods included from ClassMethods

add_shared_example_group, find_shared_example_group, shared_example_groups

Methods included from ExampleGroupMethods

#create_nested_example_group, #create_shared_example_group, #describe, #described_type, #description, #description_args, #description_parts, description_text, #example, #examples, #inherited, #it_should_behave_like, #number_of_examples, #predicate_matchers, #register, #registration_backtrace, #reset, #run, #run_after_each, #run_before_each, #set_description, #unregister, #xexample

Methods included from BeforeAndAfterHooks

#after_all_parts, #after_each_parts, #append_after, #append_before, #before_all_parts, #before_each_parts, #prepend_after, #prepend_before, #remove_after, #setup, #teardown

Methods inherited from Module

#abstract_method, #append_features, #blankslate_original_append_features, #flexmock_deprecate, #logger_name

Constructor Details

#initialize(*args, &example_group_block) ⇒ SharedExampleGroup

Returns a new instance of SharedExampleGroup.



37
38
39
40
41
# File 'lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb', line 37

def initialize(*args, &example_group_block)
  describe(*args)
  @example_group_block = example_group_block
  self.class.add_shared_example_group(self)
end

Instance Method Details

#each_ancestor_example_group_class(superclass_last = false) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



47
48
49
# File 'lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb', line 47

def each_ancestor_example_group_class(superclass_last=false)
  yield self
end

#included(mod) ⇒ Object

:nodoc:



43
44
45
# File 'lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb', line 43

def included(mod) # :nodoc:
  mod.module_eval(&@example_group_block)
end