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

Define behavior for nesting describe/steps #12

Open
nyarly opened this issue Jul 15, 2013 · 3 comments
Open

Define behavior for nesting describe/steps #12

nyarly opened this issue Jul 15, 2013 · 3 comments

Comments

@nyarly
Copy link
Member

nyarly commented Jul 15, 2013

Behavior is currently undefined. Easiest thing would be to fail completely if steps not at root or anything nested.

@vasilakisfil
Copy link

hi! How difficult would it be to enable nested steps? I think a nested step should execute all steps before that but not steps in the same indentation (same block ? ). That would help a lot in scenarios that differ slightly.

@nyarly
Copy link
Member Author

nyarly commented May 27, 2014

There's a number of use cases, and it's not entirely clear how to handle them in a straightforward way.

Picture:

steps "outside" do
  it "1" {}
  steps "in a" do
    it "1a" {}
  end
  it "2" {}
  steps "in b" do
    it "2b" {}
  end
  it "3" {}
end

What steps should run in each case?

What effect should before/after blocks in "in b" have?

Conversely, there's already shared_steps and include_steps which work the other way around: set up the common parts in a shared_steps block, include_steps everywhere that they're needed.

@vasilakisfil
Copy link

Hi! In my opinion it would be nice if rspec-steps always preserved state of the outside block and previous "it" blocks of the same block. In your example "1" blocks should preserve the state that has been achieved until that moment (let it be "outside"). Similarly "1a" preserves the state of "outside" and "1".
"2" block preserves state "start" + "1" but not "1a" and in general anything inside a nested step defined in the same block but before "2".
Similarly, "3" block runs with a starting state "start" + "1" + "2".
I hope I made myself clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants