Module: Spec::Example::SharedExampleGroup::ClassMethods

Included in:
Spec::Example::SharedExampleGroup
Defined in:
lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb

Instance Method Summary collapse

Instance Method Details

#add_shared_example_group(new_example_group) ⇒ Object



5
6
7
8
# File 'lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb', line 5

def add_shared_example_group(new_example_group)
  guard_against_redefining_existing_example_group(new_example_group)
  shared_example_groups << new_example_group
end

#find_shared_example_group(example_group_description) ⇒ Object



10
11
12
13
14
# File 'lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb', line 10

def find_shared_example_group(example_group_description)
  shared_example_groups.find do |b|
    b.description == example_group_description
  end
end

#shared_example_groupsObject



16
17
18
# File 'lib/gems/rspec-1.1.11/lib/spec/example/shared_example_group.rb', line 16

def shared_example_groups
  @shared_example_groups ||= []
end