[Rspec-devel] -s not working

aslak hellesoy aslak.hellesoy at gmail.com
Tue May 16 21:05:33 EDT 2006


On 5/16/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> I'll update the docs, but first - how would you want to see this work?
> We could just use the spec, but there could be name conflicts. I guess
> we could just run all the specs with that spec name, but then you
> might end up w/
>
> object in state 1
> - should do A when tickled
>
> object in state 2
> - should do A when tickled
>
> etc. Other options would be to accept any of the following:
>
> "context"
> "context - spec"
> "spec"
>
> then let rspec run whatever it finds that it think matches.
>

i think rspec should try to be smart, have a simple ui and give
intelligent feedback when it can't do anything. in more formal (bdd
story format) words: (as a [role] i want a [feature] so that
[benefit])


as a rspec user
i want a single option to filter out what context and/or
specifications i want to run.
so that i don't have to read the docs when i want to run a subset of my specs.

acceptance criteria:

given:

context 'foo' do
  specify 'bar' do
  end
end

context 'mooky' do
  specify 'bar' do
  end
end

when:
spec -s bar

then:
rspec runs 'foo bar' and 'mooky bar'

when:
spec -s 'foo bar'

then:
rspec runs 'foo bar'

when:
spec -s 'foo'

then:
rspec runs 'foo bar'

when:
spec -s cow

then:
rspec tells me there was no context or spec with the name 'cow'


wdyt?

> Thoughts?
>
> On 5/15/06, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> > hi,
> >
> > just got back from holiday and decided to try out the new -s option
> > (without looking at how it's implemented):
> >
> > The --help option gives very little info - I decided to try:
> >
> > ruby examples/bdd_framework_spec.rb -s 'should be adopted quickly'
> > 0 contexts, 0 specifications, 0 failures
> >
> > This should have resulted in an error message saying something like
> > "couldn't find spec"
> >
> > Then I took a really wild guess:
> >
> > ruby examples/bdd_framework_spec.rb -s 'BDD framework should be adopted quickly'
> > 1 context, 1 specification, 0 failures
> >
> > I wouldn't expect the average user to grok that. Further, the website
> > doco doesn't document this feature at all.
> >
> > Aslak
> >
> > _______________________________________________
> > Rspec-devel mailing list
> > Rspec-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-devel
> >
>
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>



More information about the Rspec-devel mailing list