Module: Spec::Example::SharedExampleGroup::ClassMethods
- Included in:
- Spec::Example::SharedExampleGroup
- Defined in:
- lib/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #count ⇒ Object
- #find(example_group_description) ⇒ Object
- #include?(group) ⇒ Boolean
- #register(*args, &block) ⇒ Object
Instance Method Details
#clear ⇒ Object
15 16 17 |
# File 'lib/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb', line 15 def clear shared_example_groups.clear end |
#count ⇒ Object
23 24 25 |
# File 'lib/vendor/plugins/rspec/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/vendor/plugins/rspec/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
19 20 21 |
# File 'lib/vendor/plugins/rspec/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/vendor/plugins/rspec/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 |