Module: RSpec::Specify::ExampleGroup
- Defined in:
- lib/specify/rspec/example_group.rb
Instance Method Summary collapse
- #_(message, options = {}, &block) ⇒ Object
- #And(message, options = {}, &block) ⇒ Object
- #But(message, options = {}, &block) ⇒ Object
- #Given(message, options = {}, &block) ⇒ Object
-
#include_steps(*args) ⇒ Object
In Rspec, example group bodies are delimited by ‘describe’ and ‘context’ methods.
- #Then(message, options = {}, &block) ⇒ Object
- #When(message, options = {}, &block) ⇒ Object
Instance Method Details
#_(message, options = {}, &block) ⇒ Object
39 40 41 |
# File 'lib/specify/rspec/example_group.rb', line 39 def _(, = {}, &block) Step :_, , , &block end |
#And(message, options = {}, &block) ⇒ Object
31 32 33 |
# File 'lib/specify/rspec/example_group.rb', line 31 def And(, = {}, &block) Step :and, , , &block end |
#But(message, options = {}, &block) ⇒ Object
35 36 37 |
# File 'lib/specify/rspec/example_group.rb', line 35 def But(, = {}, &block) Step :but, , , &block end |
#Given(message, options = {}, &block) ⇒ Object
19 20 21 |
# File 'lib/specify/rspec/example_group.rb', line 19 def Given(, ={}, &block) Step :given, , , &block end |
#include_steps(*args) ⇒ Object
In Rspec, example group bodies are delimited by ‘describe’ and ‘context’ methods. These encapsulate examples, which are delimited by ‘it’ methods. Example groups are evaluated in the context of an ExampleGroup instance. Individual examples are evaluated in the context of an instance of the ExampleGroup to which they belong.
12 13 14 15 16 17 |
# File 'lib/specify/rspec/example_group.rb', line 12 def include_steps(*args) name = args.shift shared_block = ::RSpec.world.shared_example_steps[name] shared_block or raise ArgumentError, "Could not find shared steps #{name.inspect}" instance_exec(*args, &shared_block) end |
#Then(message, options = {}, &block) ⇒ Object
27 28 29 |
# File 'lib/specify/rspec/example_group.rb', line 27 def Then(, ={}, &block) Step :then, , , &block end |
#When(message, options = {}, &block) ⇒ Object
23 24 25 |
# File 'lib/specify/rspec/example_group.rb', line 23 def When(, ={}, &block) Step :when, , , &block end |