module RSpec::Core::Subject::ExampleGroupMethods

def subject(name=nil, &block)

Other tags:
    See: ExampleMethods#should -
    See: ExampleMethods#subject -

Parameters:
  • block () -- defines the value to be returned by `subject` in examples
  • name (String, Symbol) -- used to define an accessor with an
def subject(name=nil, &block)
  if name
    let(name, &block)
    subject { send name }
  else
    block ? @explicit_subject_block = block : explicit_subject || implicit_subject
  end
end