[rspec-users] How to spec a (Trollop-based) binary’s internal state?
matt at mattwynne.net
Fri Nov 14 17:59:09 EST 2008
On 14 Nov 2008, at 20:56, Shot (Piotr Szotkowski) wrote:
> Seeing as my binary grew to over 80 lines, I guess my best bet is to
> pull out the gist of it into a separate Runner class, spec it (with
> mocks/stubs/fixtures) so it runs in a sane time and then only create
> a think binary wrapper around it (which will basically parse the
> options, set the config and then run the runner).
Have a look at the source code for cucumber's binary, or rspec's
'spec' command. They're both about four lines long creating a
(eminently spec-able) class that does the rest.
More information about the rspec-users