A slightly terser i.e. better way to write that test

That test being the most simplest most basicest test from my last posthttp://iainbarnett.me.uk/posts/When-you-dont-….

require 'tasty_sarnie' # implied from now on

describe TastySarnie do
  subject { TastySarnie( "arg1", "arg2" ) }
  it { should_not be_nil }

This is better because:

  • It’s shorter, and therefore more satisfying to any l33t haxor.
  • It’s shorter, so easier to read.
  • It only tests one thing at a time. Using the it "blah blah and then she was like, and I was like..." syntax tends to lead to several tests inside one big it.
  • Each it will not have an effect on the next it.
  • It’s shorter, did I say that was better already?
Added on:
Last updated: