Wyatt: The simple way to generate RSpec tests
This friendly Siberian Husky will take the pain out of RSpec tests
If you’re just getting started with test-driven development or are an old pro, Wyatt is a fun and helpful Chrome Extension. Wyatt, developed by Alex Grande, was created because he felt like he was always “banging his head against RSpec, dealing with those generic errors, match not found or whatever”. Alex felt there had to be a better, more effective way to do things and that’s when he started his mission to make the world a better place by improving the way we generate our tests.
What Wyatt does is record the specs while you click through the feature you’re testing.
Here are four easy steps to get the Wyatt Chrome Extension installed.
- Visit the Chrome Web Store .
- Type Wyatt in the search bar and look for the Siberian Husky icon named Wyatt.
- Click “Add To Chrome” and a pop-up will appear stating that it can read and change all your data on the websites you visit.
- Click “Add extension” and another pop-up will appear, letting you know that clicking the Siberian Husky icon will start your test.
Here’s how I used Wyatt to create a spec for a client signup.
- In your nav bar click the Siberian Husky icon.
- The Wyatt app will now open and prompt you to start recording. It will also provide two optional fields: “Describe” and “Context” along with a field for your “it” statement.
- I filled in my “Describe” with “Client sign up”.
- I filled in my “it” statement with “allows client to sign up”.
- Next, I clicked “Start Recording”.
- I filled in my form and clicked next.
- I clicked the Wyatt app in the nav bar so I could fill in the “expect” portion of my spec.
- I filled in the “expect” portion and clicked “save”.
Wyatt produced the spec from my clicks and typing in mere minutes!!!
You may notice there are two empty strings for the select boxes. If Wyatt doesn’t know how to grab a specialized element like select 2’s you will have to go and fill them in manually. Wyatt certainly gets you on your way though and is a tool I will use often.
Wyatt is an open source project and would love contributors to help it evolve.