lib/nrser/described/cucumber/world/expect.rb
# Find the nearest description instance that's class has a provided "human
# name", and create an RSpec expectation for it's {Base#subject}.
# 
# @note
#   This will trigger subject resolution on the found description instance if 
#   its subject is not already resolved.
# 
# @example Expect the nearest {NRSER::Described::Method}
#   expect_described "method"
# 
# @param [::String] human_name
#   A {NRSER::Described::Base.human_name} for the desired
#   {NRSER::Described::Base} subclass.
# 
# @return [RSpec::Expectations::ExpectationTarget]
# 
Find the nearest description instance that's class has a provided "human
name", and create an RSpec expectation for it's {Base#subject}.
Find the nearest description instance that ' s class has a provided " human name " and create an RSpec expectation for it ' s { Base#subject } .
def expect_described described
    if described.is_a? ::String
      described = hierarchy.find_by_human_name! described
    end
    expect described.resolve!( hierarchy ).subject
  end
def expect_described described if described . is_a? :: String described = hierarchy . find_by_human_name! described end expect described . resolve! ( hierarchy ) . subject end
Find the nearest description instance that's class has a provided "human
name", and create an RSpec expectation for it's {Base#subject}.
Find the nearest description instance that ' s class has a provided " human name " and create an RSpec expectation for it ' s { Base#subject } .
None
RSpec::Expectations::ExpectationTarget
described
<not_specific>
<not_specific>
human_name A {NRSER::Described::Base.human_name} for the desired {NRSER::Described::Base} subclass.
human_name A { NRSER :: Described :: Base . human_name } for the desired { NRSER :: Described :: Base } subclass .
note
This will trigger subject resolution on the found description instance if its subject is not already resolved.
This will trigger subject resolution on the found description instance if its subject is not already resolved .
example
Expect the nearest {NRSER::Described::Method} expect_described "method"
Expect the nearest { NRSER :: Described :: Method } expect_described " method "