VoiceGem

How to dictate an RSpec example, and where the quotes glue

RSpec descriptions are English sentences inside quotes, which dictate well, but the quote marks glue to the bare keywords sitting on either side of them. Saying “it double quote returns the order double quote do” returns it"returns the order"do, so two spaces need adding back.

A twelve-word RSpec example header costs about 14 seconds typed against about 4.4 seconds spoken. (sources: Dhakal, Feit, Kristensson & Oulasvirta, “Observations on Typing from 136 Million Keystrokes”, CHI 2018, 168,000 participants, 136 million keystrokes; Yuan, Liberman & Cieri, “Towards an Integrated Understanding of Speaking Rate in Conversation”, Interspeech 2006, 2,438 American English telephone conversations (Switchboard corpus). The speech figure is conversational rate, not a measured dictation rate — no such measurement exists.)

What lands in your editor
it"returns the archived order for a deleted customer"do

This tool runs entirely in your browser. Nothing you type is sent anywhere, stored, or logged.

Step by step

  1. 1

    Say the block keyword

    Speak “it” or “describe”. Neither is in VoiceGem's lookup table, so both pass through untouched.

  2. 2

    Open the quoted description

    Say “double quote” then the sentence. The quote binds forward, so it glues to the keyword before it and the space needs adding back.

  3. 3

    Close the quote and say “do”

    Speak “double quote do”. The closing mark binds backward onto the last word and forward onto do, so a second space is needed there.

  4. 4

    Dictate the expectation

    Say the expect line as brackets and periods. Expectations dictate cleanly — “expect open paren result close paren dot to eq open paren 3 close paren” needs no fixes.

RSpec is the one place VoiceGem's quote binding works against you

Both quote characters attach on both sides, which is the right choice almost everywhere: it is what makes a multi-word string literal come out closed up. RSpec is the exception, because its syntax puts a bare keyword immediately before the opening quote and another immediately after the closing one.

Two spaces per example is the cost, and no phrasing avoids it. The Deterministic Pass has one entry per character with one pair of flags, and the flags that serve every string literal in every other language are the ones that glue an RSpec description to its keywords.

Where the manual way breaks

Typing an RSpec block is quick and Ruby's syntax is short by design. For a three-word description nothing here is faster.

Long behavioural descriptions are still worth speaking, spacing included. RSpec descriptions are meant to read as sentences, and a sentence is cheaper to say than to type — two spaces added back is a smaller cost than a description shortened because typing it was tedious.

Doing this somewhere else? the speech-to-code converter on this site, dictating Ruby methods specifically, how dictating Go tests works, or dictating JUnit tests, step by step.

Common questions

Both quote characters attach on both sides, which is what makes multi-word string literals work everywhere else. Add the two spaces back after dictating.

Yes. An expect line is brackets, periods and identifiers, all of which bind correctly, so it needs no fixes.

No. VoiceGem has one entry per character with one pair of flags, and those flags serve string literals in every other language.

Dictate an RSpec example and see exactly which two spaces to add.

Open the tool