The 5 Rules of Simple RSpec Tests

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 #rspec #tests https://rubyonrails.ba/single/the-5-rules-of-simple-rspec-tests

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles