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

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

Instance Method Summary collapse

Instance Method Details

#clearObject



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

def clear
  shared_example_groups.clear
end

#countObject



23
24
25
# File 'lib/gems/rspec-1.1.12/lib/spec/example/shared_example_group.rb', line 23

def count
  shared_example_groups.length
end

#find(example_group_description) ⇒ Object



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

def find(example_group_description)
  shared_example_groups.find {|b| b.description == example_group_description}
end

#include?(group) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/gems/rspec-1.1.12/lib/spec/example/shared_example_group.rb', line 19

def include?(group)
  shared_example_groups.include?(group)
end

#register(*args, &block) ⇒ Object



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

def register(*args, &block)
  new_example_group = new(*args, &block)
  shared_example_groups << new_example_group unless already_registered?(new_example_group)
  new_example_group
end