Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spec lib improvements] Prepend describe block names to spec names #141

Closed
faultyserver opened this issue Jan 31, 2018 · 1 comment
Closed
Labels
feature-request Any request for a new feature of the language. Includes both syntax and library features. stdlib Any issue relating to the standard library (Myst code) of Myst.
Milestone

Comments

@faultyserver
Copy link
Member

faultyserver commented Jan 31, 2018

This is part of a family of issues relating to Spec library improvements.

When defining specs within a describe block, it's common for those specs to have the describe blocks name prepended to their name in all places where the name of the spec is presented.

For example, with a spec suite like this:

describe "Some object" do
  it "does a thing" do
    assert(true == false)
  end
end

The error output should have the spec name "Some object does a thing".

Generally, this is done by having a Context object that holds onto the current name path at that point in the code. Entering a describe block would then push a new Context object to a stack, and each it block would then read the name path from the Context object at the top of that stack and prepend it to the given name for the spec when creating the SingleSpec instance.

An implementation like this should also work with nested describe blocks.

@faultyserver faultyserver added stdlib Any issue relating to the standard library (Myst code) of Myst. feature-request Any request for a new feature of the language. Includes both syntax and library features. labels Jan 31, 2018
@faultyserver faultyserver added this to the Next milestone Feb 16, 2018
@faultyserver
Copy link
Member Author

Implemented by #161.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Any request for a new feature of the language. Includes both syntax and library features. stdlib Any issue relating to the standard library (Myst code) of Myst.
Projects
None yet
Development

No branches or pull requests

1 participant