Tricks with RSpec components outside RSpec

What?

In this short post I’d like to show how some of RSpec components (matchers and expectations) can be used for a greater good outside your tests. Like in your normal everyday scripts.

Why?

Trying to be expressive, concise and readable, RSpec have developed a great number of idioms, mechanisms and approaches. They are reliable, most of Rubyists familiar with them, and code becames pretty expressive.

While I don’t recommend trying this at home using the tricks shown below in your Big Enterprise Production core, you may like those things for short scripts, experiments, insights, and just for fun.


Tricks with RSpec components outside RSpec #ruby #rubydeveloper #rubyonrails #rspec https://rubyonrails.ba/single/tricks-with-rspec-components-outside-rspec

Nezir Zahirovic

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

related articles