The 5 Rules of Simple RSpec Tests
13-May-2021 1192
The 5 “rules” I try to follow in order to write simple RSpec tests.Let’s GO.Everything above 2 is a code-smell and causes alarm bells in my head to ring. The more levels of nesting you have, the harder it is to understand what a given example is doing. If you add before/after hooks to the mix, it’ll become even worse.I often reduce nesting by simply using example descriptions like that:.
The 5 Rules of Simple RSpec Tests #ruby #rubydeveloper #rubyonrails #Rules #Simple #RSpec #Tests #rspec #tests https://rubyonrails.ba/link/the-5-rules-of-simple-rspec-tests