Testing is a critical part of software development. Explore the built-in unit testing features of Ruby, as well as how to use Cucumber and behavior driven development (BDD) to help with testing Ruby code.
Learning Objectives
Ruby Full Stack Development: Unit Testing and Behavior Driven Development
- describe how unit testing can benefit development with Ruby
- create and run a unit test
- identify the different assertion types and how they can be used to test code
- use assertions to validate numeric values
- use assertions to validate strings or patterns in strings
- use assertions to verify objects and object properties
- set up and tear down prerequisites for running a unit test
- describe behavior driven development and how it can be used for testing using Cucumber
- install Cucumber and create a Cucumber project
- create a scenario in a Cucumber .feature file
- create the step definitions for a Cucumber scenario and run the test
- use unit tests and behavior driven development to verify code functionality