#366 √ resolved
Brian Takita

plain text Example format that is arbitrarily nested

Reported by Brian Takita | April 5th, 2008 @ 11:20 PM | in No-Milestone-Assigned

This will be an indentation based format that follows ExampleGroup nesting.

For example:

describe User do

  describe "when logged in" do

    describe "for the first time" do

      it "sends a welcome message"

      it "sets updated_at to now"

    end

    describe "and has previously logged in" do

      it "does not send a welcome message"

      it "sets updated_at to now"

    end

  end

end

Would look like:

User

  when logged in

    for the first time

      sends a welcome message

      sets updated_at to now

    and has previously logged in

      does not send a welcome message

      sets updated_at to now

This would be also be useful as a dry run (a rake task) where you can see the structure of the specs.

Comments and changes to this ticket

  • David Chelimsky

    David Chelimsky April 6th, 2008 @ 04:11 AM

    • → State changed from “new” to “open”

    Do you see this as always being the output or more as an option?

  • Brian Takita

    Brian Takita April 6th, 2008 @ 08:35 PM

    I was thinking of this being an option by adding another Formatter. A name could be NestedDocFormater.

    The situation we are having is probably what led you to have plain text stories.

    There is a lot of contextual setup in which nested describes express very well, but the implementation of the Examples get in the way and make it difficult to see the logical structure of the ExampleGroup.

  • David Chelimsky

    David Chelimsky April 6th, 2008 @ 08:55 PM

    An additional formatter for this sounds great! Thanks.

  • Brian Takita

    Brian Takita May 22nd, 2008 @ 10:02 AM

    • → State changed from “open” to “resolved”

    Checked in 294acb030f811fd546735aa819cdcf89d142b635

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket