[Rspec-devel] PROPOSAL: --format and --dry-run

David Chelimsky dchelimsky at gmail.com
Tue May 2 08:46:12 EDT 2006


I'm on board for eliminating --verbose and --doc. I like the idea of a
switch to supply the formatter, but I'd like it to be optionally less
verbose. I always use the -v switch, and I wouldn't want to have to
type all of that to get the same effect. Also, maybe I'm just used to
the format I'm used to, but I'd like the current verbose format to be
available in addition to the rdoc format. That format is also the same
as agiledox, so it will be familiar to anyone who's used that tool.

So I'd propose something like this:

--format OR -f sets the formatter (default is the current default --
dots and Fs)

legal values for this option would be:
doc
rdoc
html

and you can use the first letter of each as a shortcut
d
r
h

So, for clarity in shell scripts, for example, you might type this:
spec . --format html

while on the command line you might abbreviate:
spec . -f h

"doc" or "d" gets you this:
BDD framework
- should be adopted quickly
- should be intuitive

"rdoc" or "r" gets you this:
# BDD framework
# * should be adopted quickly
# * should be intuitive

"html" or "h" gets you html

The only think I'm not sure about is the --dry-run option. I think
that I'd like the option to add that for the doc format, but that for
the rdoc format, which would generally be used specifically to
generate rdocs, dry-run should be the default. Would that be too
confusing?

Also, I'd propose that we supply messages for --verbose and --doc that
explain that these options are no longer valid and what to use. Only
for the next release or so.

Thoughts?

On 5/2/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> DOH!
>
> Hit send somehow. More on that later....
>
> On 5/2/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> > I ALWAYS
> >
> > On 5/1/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> > > Hi,
> > >
> > > I'm planning to add tool number eight to
> > > http://rspec.rubyforge.org/tools/index.html:
> > > HTML reports a la
> > > http://forge.objectweb.org/nightlybuilds/c-jdbc/tests/today/overview-summary.html
> > > (except a better browsing experience). HTML reports are particularly
> > > useful for larger projects, especially when specs are run on a
> > > continuous integration server - it makes it easier to spot the errors
> > > when they occur.
> > >
> > > I've done some refactorings in svn to make this a little easier. The
> > > old SimpleTextReporter is now two classes: Reporter and TextOutputter
> > > (Reporter has-a Reporter is the plan).
> > >
> > > I'd like to be able to specify the reporter on the command line via a
> > > --format option.
> > > It seems natural to use this option to specify --format=text
> > > (default), --format=rdoc and --format-html. So I'm planning a
> > > HtmlOutputter.
> > >
> > > Some additional refactorings would make this a little cleaner. First
> > > of all, the current --verbose option results in output that is very
> > > similar to the output produced by --doc. I propose to remove both of
> > > these options.
> > >
> > > --verbose becomes --format=rdoc
> > > --doc becomes --format=rdoc --dry-run
> > >
> > > The assumption here is that the rdoc format:
> > > # BDD framework
> > > # * should be adopted quickly
> > > # * should be intuitive
> > >
> > > is readable enough as it is in the console.
> > >
> > > The --dry-run option would only generate output (with whatever
> > > --format is specified), without actually running the specs. --dry-run
> > > is a common option for many other command line tools.
> > >
> > > I think these proposed command line changes would make the interface
> > > cleaner, as well as clean up some duplication inside rspec.
> > >
> > > What do you think?
> > >
> > > Aslak
> > >
> > > _______________________________________________
> > > Rspec-devel mailing list
> > > Rspec-devel at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/rspec-devel
> > >
> >
>



More information about the Rspec-devel mailing list