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!

Testing class methods via rspec explicit subjects

I explore a trick for testing methods via the use of rspec’s explicit subject syntax. Some may consider it hacky, but it gives you a clean declarative way to test a class method under variation of it’s arguments.

I’m honestly considering just blogging via gist directly lately, as then I don’t have to deal with running anything myself or brain-dead WYSIWYG, and I get syntax highlighting for free. I could just post the gist link to posterous, then, but maybe the same content in gist form itself makes as good of a blog post.

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