Module: RSpec::Specify::ExampleGroup
- Defined in:
- lib/specify/rspec/example_group.rb
Instance Method Summary collapse
- #And(message, options = {}, &block) ⇒ Object
- #But(message, options = {}, &block) ⇒ Object
- #example(message, options = {}, &block) ⇒ Object
- #fact(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
- #rule(message, options = {}, &block) ⇒ Object
- #specify(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
#And(message, options = {}, &block) ⇒ Object
31 32 33 |
# File 'lib/specify/rspec/example_group.rb', line 31 def And(, = {}, &block) Action :and, , , &block end |
#But(message, options = {}, &block) ⇒ Object
35 36 37 |
# File 'lib/specify/rspec/example_group.rb', line 35 def But(, = {}, &block) Action :but, , , &block end |
#example(message, options = {}, &block) ⇒ Object
47 48 49 |
# File 'lib/specify/rspec/example_group.rb', line 47 def example(, = {}, &block) Action :example, , , &block end |
#fact(message, options = {}, &block) ⇒ Object
55 56 57 |
# File 'lib/specify/rspec/example_group.rb', line 55 def fact(, = {}, &block) Action :fact, , , &block end |
#Given(message, options = {}, &block) ⇒ Object
19 20 21 |
# File 'lib/specify/rspec/example_group.rb', line 19 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
39 40 41 |
# File 'lib/specify/rspec/example_group.rb', line 39 def it(, = {}, &block) Action :it, , , &block end |
#rule(message, options = {}, &block) ⇒ Object
51 52 53 |
# File 'lib/specify/rspec/example_group.rb', line 51 def rule(, = {}, &block) Action :rule, , , &block end |
#specify(message, options = {}, &block) ⇒ Object
43 44 45 |
# File 'lib/specify/rspec/example_group.rb', line 43 def specify(, = {}, &block) Action :specify, , , &block end |
#step(message, options = {}, &block) ⇒ Object
63 64 65 |
# File 'lib/specify/rspec/example_group.rb', line 63 def step(, = {}, &block) Action :step, , , &block end |
#test(message, options = {}, &block) ⇒ Object
59 60 61 |
# File 'lib/specify/rspec/example_group.rb', line 59 def test(, = {}, &block) Action :test, , , &block end |
#Then(message, options = {}, &block) ⇒ Object
27 28 29 |
# File 'lib/specify/rspec/example_group.rb', line 27 def Then(, ={}, &block) Action :then, , , &block end |
#When(message, options = {}, &block) ⇒ Object
23 24 25 |
# File 'lib/specify/rspec/example_group.rb', line 23 def When(, ={}, &block) Action :when, , , &block end |