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