Skip to content

Proposal: raise NotImplementedError #6

@hosh

Description

@hosh

This pattern happens a lot:

let(:something) { fail NotImplementedError, "Must define let(:something)" }

Proposal:

let(:something)

Would leave :something unimplemented. When there is an attempt to call it, it would raise

NotImplementedError ("Must define let(:something)")

This pattern happens a lot. The question is if this is explicit enough. Code that explicitly spells out something has not been defined seems to be better.

An alternative is to have the helper not_implemented() So it looks like:

let(:something) { not_implemented }

It might be trickier to get where the caller is from, and might be done with something like binding_of_caller.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions