Module: RSpec::Specify::ExampleGroup

Defined in:
lib/specify/rspec/example_group.rb

Instance Method Summary collapse

Instance Method Details

#And(message, options = {}, &block) ⇒ Object



31
32
33
# File 'lib/specify/rspec/example_group.rb', line 31

def And(message, options = {}, &block)
  Action :and, message, options, &block
end

#But(message, options = {}, &block) ⇒ Object



35
36
37
# File 'lib/specify/rspec/example_group.rb', line 35

def But(message, options = {}, &block)
  Action :but, message, options, &block
end

#example(message, options = {}, &block) ⇒ Object



47
48
49
# File 'lib/specify/rspec/example_group.rb', line 47

def example(message, options = {}, &block)
  Action :example, message, options, &block
end

#fact(message, options = {}, &block) ⇒ Object



55
56
57
# File 'lib/specify/rspec/example_group.rb', line 55

def fact(message, options = {}, &block)
  Action :fact, message, options, &block
end

#Given(message, options = {}, &block) ⇒ Object



19
20
21
# File 'lib/specify/rspec/example_group.rb', line 19

def Given(message, options={}, &block)
  Action :given, message, options, &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(message, options = {}, &block)
  Action :it, message, options, &block
end

#rule(message, options = {}, &block) ⇒ Object



51
52
53
# File 'lib/specify/rspec/example_group.rb', line 51

def rule(message, options = {}, &block)
  Action :rule, message, options, &block
end

#specify(message, options = {}, &block) ⇒ Object



43
44
45
# File 'lib/specify/rspec/example_group.rb', line 43

def specify(message, options = {}, &block)
  Action :specify, message, options, &block
end

#step(message, options = {}, &block) ⇒ Object



63
64
65
# File 'lib/specify/rspec/example_group.rb', line 63

def step(message, options = {}, &block)
  Action :step, message, options, &block
end

#test(message, options = {}, &block) ⇒ Object



59
60
61
# File 'lib/specify/rspec/example_group.rb', line 59

def test(message, options = {}, &block)
  Action :test, message, options, &block
end

#Then(message, options = {}, &block) ⇒ Object



27
28
29
# File 'lib/specify/rspec/example_group.rb', line 27

def Then(message, options={}, &block)
  Action :then, message, options, &block
end

#When(message, options = {}, &block) ⇒ Object



23
24
25
# File 'lib/specify/rspec/example_group.rb', line 23

def When(message, options={}, &block)
  Action :when, message, options, &block
end