Recipe 43Test an Arduino Project Using Serial

Problem

You want to use Cucumber to test an Arduino project or other embedded device with no network support.

Ingredients

  • serialport,[282] a Ruby library for sending and receiving data over a serial port

  • An Arduino-compatible board[283]

  • The free Arduino IDE[284]

  • A serial connection to your embedded device, either through a built-in port or with a USB to RS-232 converter

  • (Optional) Pushbuttons, LEDs, and resistors if you want to hook up the controls for real

Solution

When we’re testing an embedded device, we have to do without some of the luxuries of desktop or web apps, such as network connectivity or preexisting test libraries. But as long as we can create a serial connection to the device ...

Get Cucumber Recipes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.