RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

The tiniest way to add nested contexts to your tests

nest-unit is the smallest possible way to get nested context support for Test::Unit, clocking in at 70 lines of code. I think.

Comments

Cool, but what’s the motivation for this beyond, say, context? The syntax seems identical.

There’s actually an even smaller one from Chris Wanstrath on gist somewhere. It was like 20-25 lines.

1 line and includes mocking… http://gist.github.com/51272

But yeah, it’s not very useful ;) So I second Peter’s question.

Context is really cool, but it had features I didn’t need (shared behaviors, some Rails-y stuff, etc). I just wanted to see what it would take to get only nested contexts. Here’s Chris’ approach: gist.github.com/25455.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in