Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
by
Lessons:15Length:2.5 hours
Crs 82015
  • Overview
  • Transcript

2.7 Transforms

Cucumber features are parsed by the 'gherkin' gem. It uses regular expressions to match the behavior you want to provoke. The parsing is done in such a way that it passes strings to your step definitions, so if you need something other than strings, you’ll need to transform that input. Cucumber transforms will help you ease that passage from feature content into proper Ruby code.

Also, if you want to have a set of tabular data that you can process at once, Cucumber lets you have simple ASCII tables that are instantly converted to Ruby hashes. It’s a terrific way, for example, to setup a data source with some quick fixtures. You’ll how to take advantage of those tables, manipulate them and reuse them with transforms as well.