Skip to content

Instantly share code, notes, and snippets.

@adamrdavid
adamrdavid / db_guidelines.md
Last active July 14, 2023 13:03
the darndest things

Request spec subjects

Who TF cares honestly? 🤷‍♂️ 🤷‍♀️

Great question. Let me preface this by saying I HATE talking about RSpec best practices. It's irrelevant to shipping software and tends to churn up a lot of long, useless discussion. However, I think it's useful to consider best practices when there is a demonstrable functional (not stylistic) difference between two approaches that can affect maintainability, flexibility, and speed.

One style I see quite a lot looks a bit like this:

The before hook tower of doom

@JunichiIto
JunichiIto / alias_matchers.md
Last active July 18, 2024 15:03
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value