Eddy Luten

Programmer at Large in the Bay Area

Read this first

RSpec be_truthy, exist, or be true?

The documentation for RSpec is amazingly detailed, but sometimes falls a bit short on when to apply certain matchers. In many of the specs that I’ve reviewed, incorrect matchers were used to test for pure Boolean values.

 be_truthy and be_falsey

expect(some_evaluation).to be_truthy
expect(some_evaluation).to be_falsey

The matcher be_truthy should only be used when expecting an evaluation to be not nil and not false.

The matcher be_falsey should only be used when expecting an evaluation to be nil or false.

Notice that be_truthy does not actually check for the Boolean value true.

If you have a method that should only be evaluated into a Boolean, do not use these matchers for your spec.

 be true and be false

expect(some_evaluation).to be true
expect(some_evaluation).to be false

The matchers be true and be false expect only true and false returned, respectively. This is a straight

Continue reading →

Switched to Svbtle

I’m trying a new blogging service named Svbtle, which is minimalist and supports Markdown syntax. Yay! I love using text editors such as OmmWriter to quickly get ideas out without distractions.

While I like the ability to host my content via GitHub Pages (openglbook is still served through it), I just want a platform where I can quickly bang out a blog post in case I don’t have access to my GitHub repo.

So while there’s not much new content yet, this should give me the ability to write more often. The old content is still available via a public repo here (if for some reason you’re interested in it).


Continue reading →

Subscribe to Eddy Luten

Don’t worry; we hate spam with a passion.
You can unsubscribe with one click.