Building Tests in Ruby: Expectations and Matchers

When building tests in Ruby, expectations are a very important component. They allow you to set the intended results of the function, method, class, etc. that you are testing. The way that we set expectations in Ruby tests is by using expect(code).to or, the opposite, expect(code).not_to.If you are thinking that these code snippets seem unfinished you are correct. There is one other component needed to finish an expect statement: matchers.
Building Tests in Ruby: Expectations and Matchers #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper

Nezir Zahirovic

Freelance software developer Ruby On Rails (4 years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles