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.
- #it(message, options = {}, &block) ⇒ Object
- #Step(message, options = {}, &block) ⇒ Object
- #Test(message, options = {}, &block) ⇒ Object
- #Then(message, options = {}, &block) ⇒ Object
- #When(message, options = {}, &block) ⇒ Object
Instance Method Details
#_(message, options = {}, &block) ⇒ Object
47 48 49 |
# File 'lib/specify/rspec/example_group.rb', line 47 def _(, = {}, &block) Action :_, , , &block end |
#And(message, options = {}, &block) ⇒ Object
39 40 41 |
# File 'lib/specify/rspec/example_group.rb', line 39 def And(, = {}, &block) Action :and, , , &block end |
#But(message, options = {}, &block) ⇒ Object
43 44 45 |
# File 'lib/specify/rspec/example_group.rb', line 43 def But(, = {}, &block) Action :but, , , &block end |
#Given(message, options = {}, &block) ⇒ Object
27 28 29 |
# File 'lib/specify/rspec/example_group.rb', line 27 def Given(, ={}, &block) Action :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 |
#it(message, options = {}, &block) ⇒ Object
51 52 53 |
# File 'lib/specify/rspec/example_group.rb', line 51 def it(, = {}, &block) Action :it, , , &block end |
#Step(message, options = {}, &block) ⇒ Object
23 24 25 |
# File 'lib/specify/rspec/example_group.rb', line 23 def Step(, ={}, &block) Action :step, , , &block end |
#Test(message, options = {}, &block) ⇒ Object
19 20 21 |
# File 'lib/specify/rspec/example_group.rb', line 19 def Test(, ={}, &block) Action :test, , , &block end |
#Then(message, options = {}, &block) ⇒ Object
35 36 37 |
# File 'lib/specify/rspec/example_group.rb', line 35 def Then(, ={}, &block) Action :then, , , &block end |
#When(message, options = {}, &block) ⇒ Object
31 32 33 |
# File 'lib/specify/rspec/example_group.rb', line 31 def When(, ={}, &block) Action :when, , , &block end |