Class: RSpec::Steps::Let

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec-steps/lets.rb

Direct Known Subclasses

LetBang

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



2
3
4
# File 'lib/rspec-steps/lets.rb', line 2

def block
  @block
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/rspec-steps/lets.rb', line 2

def name
  @name
end

Instance Method Details

#define_on(step_list, group) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/rspec-steps/lets.rb', line 3

def define_on(step_list, group)
  name = self.name
  step_list.add_let(name, block)

  group.let(name) do
    step_list.let_memo(name, self)
  end
end