'Parses and runs steps given in string form.
In your step definitions, you can use this to run one step from another.
e.g.
@step(\'something ordinary\')
def something(step):
step.behave_as(\'Given something defined elsewhere\')
@step(\'something defined elsewhere\')
def elsewhere(step):
# actual step behavior, maybe.
This will raise the error of the first failing step (thus halting
execution of the step) if a subordinate step fails.'

def behave_as(self, string):

    lines = string.split('\n')
    steps = self.many_from_lines(lines)
    if hasattr(self, 'scenario'):
        for step in steps:
            step.scenario = self.scenario
    (_, _, steps_failed, steps_undefined) = self.run_all(steps)
    if ((not steps_failed) and (not steps_undefined)):
        self.passed = True
        self.failed = False
        return self.passed
    self.passed = False
    self.failed = True
    assert (not steps_failed), steps_failed[0].why.exception
    assert (not steps_undefined), ('Undefined    step:    %s' % steps_undefined[0].sentence)
