Class: Spec::Story::StepMother

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/rspec-1.1.12/lib/spec/story/step_mother.rb

Instance Method Summary collapse

Constructor Details

#initializeStepMother

Returns a new instance of StepMother.



4
5
6
# File 'lib/gems/rspec-1.1.12/lib/spec/story/step_mother.rb', line 4

def initialize
  @steps = StepGroup.new
end

Instance Method Details

#clearObject



28
29
30
# File 'lib/gems/rspec-1.1.12/lib/spec/story/step_mother.rb', line 28

def clear
  @steps.clear
end

#empty?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/gems/rspec-1.1.12/lib/spec/story/step_mother.rb', line 32

def empty?
  @steps.empty?
end

#find(type, unstripped_name) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gems/rspec-1.1.12/lib/spec/story/step_mother.rb', line 16

def find(type, unstripped_name)
  name = unstripped_name.strip
  if @steps.find(type, name).nil?
    @steps.add(type,
    Step.new(name) do
      raise Spec::Example::ExamplePendingError.new("Unimplemented step: #{name}")
    end
    )
  end
  @steps.find(type, name)
end

#store(type, step) ⇒ Object



12
13
14
# File 'lib/gems/rspec-1.1.12/lib/spec/story/step_mother.rb', line 12

def store(type, step)
  @steps.add(type, step)
end

#use(new_step_group) ⇒ Object



8
9
10
# File 'lib/gems/rspec-1.1.12/lib/spec/story/step_mother.rb', line 8

def use(new_step_group)
  @steps << new_step_group
end