rogerdpack
2010-Jan-28 18:54 UTC
[rspec-users] somewhat confused by the help instructions...
As a note of feedback, when I do a spec --help, I saw this line... -e, --example [NAME|FILE_NAME] Execute example(s) with matching name(s). If the argument is the path to an existing file (typically generated by a previous run using --format failing_examples:file.txt), then the examples on each line of that file will be executed. If the file is empty, all examples will be run (as if -- example was not specified). so I, trying to be clever, passed it something to match: E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"the result" Finished in 0.125 seconds 0 examples, 0 failures Passing it the full test name seems to work, however: E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"returns the result of the run_tests method from the forked child" ... Finished in 0.34375 seconds 3 examples, 0 failures Suggestion: rephrase the help as "runs the test whose name equals the one specified" (instead of using the word "matches" which to me somehow meant "regex"), or change the matching to be regex matching (this one is what I would personally prefer--then you don''t have to put full test names on the command line). Thoughts? -r
David Chelimsky
2010-Jan-30 06:45 UTC
[rspec-users] somewhat confused by the help instructions...
On Thu, Jan 28, 2010 at 12:54 PM, rogerdpack <rogerpack2005 at gmail.com> wrote:> As a note of feedback, when I do a spec --help, I saw this line... > > ? ?-e, --example [NAME|FILE_NAME] ? Execute example(s) with matching > name(s). If the argument is > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? the path to an existing file > (typically generated by a previous > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? run using --format > failing_examples:file.txt), then the examples > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? on each line of that file will be > executed. If the file is empty, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? all examples will be run (as if -- > example was not specified). > > so I, trying to be clever, passed it something to match: > > E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"the result" > > > Finished in 0.125 seconds > > 0 examples, 0 failures > > > Passing it the full test name seems to work, however: > > E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"returns the > result of the run_tests method from the forked child" > ... > > Finished in 0.34375 seconds > > 3 examples, 0 failures > > > Suggestion: > > rephrase the help as "runs the test whose name equals the one > specified" (instead of using the word "matches" which to me somehow > meant "regex"), or > > change the matching to be regex matching (this one is what I would > personally prefer--then you don''t have to put full test names on the > command line). > > Thoughts?Actually, I''m thinking of not supporting this in rspec-2. I personally find the line number much more useful, since you can just copy it directly from the failure messages to re-run something: spec path/to/spec.rb:37 WDYT?> -r > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Matt Wynne
2010-Jan-30 13:31 UTC
[rspec-users] somewhat confused by the help instructions...
On 30 Jan 2010, at 06:45, David Chelimsky wrote:> On Thu, Jan 28, 2010 at 12:54 PM, rogerdpack > <rogerpack2005 at gmail.com> wrote: >> As a note of feedback, when I do a spec --help, I saw this line... >> >> -e, --example [NAME|FILE_NAME] Execute example(s) with matching >> name(s). If the argument is >> the path to an existing file >> (typically generated by a previous >> run using --format >> failing_examples:file.txt), then the examples >> on each line of that file will be >> executed. If the file is empty, >> all examples will be run (as if >> -- >> example was not specified). >> >> so I, trying to be clever, passed it something to match: >> >> E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"the result" >> >> >> Finished in 0.125 seconds >> >> 0 examples, 0 failures >> >> >> Passing it the full test name seems to work, however: >> >> E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"returns the >> result of the run_tests method from the forked child" >> ... >> >> Finished in 0.34375 seconds >> >> 3 examples, 0 failures >> >> >> Suggestion: >> >> rephrase the help as "runs the test whose name equals the one >> specified" (instead of using the word "matches" which to me somehow >> meant "regex"), or >> >> change the matching to be regex matching (this one is what I would >> personally prefer--then you don''t have to put full test names on the >> command line). >> >> Thoughts? > > Actually, I''m thinking of not supporting this in rspec-2. I personally > find the line number much more useful, since you can just copy it > directly from the failure messages to re-run something: > > spec path/to/spec.rb:37This is great except when you use macros or other tricks to generate examples - then there isn''t a 1:1: mapping from line number to example. I often find it quite annoying to have to quote the whole example description, so I actually quite like Roger''s idea about using regexp matching.> WDYT? > >> -r >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-userscheers, Matt http://mattwynne.net +447974 430184
David Chelimsky
2010-Jan-30 14:38 UTC
[rspec-users] somewhat confused by the help instructions...
On Sat, Jan 30, 2010 at 7:31 AM, Matt Wynne <matt at mattwynne.net> wrote:> > On 30 Jan 2010, at 06:45, David Chelimsky wrote: > >> On Thu, Jan 28, 2010 at 12:54 PM, rogerdpack <rogerpack2005 at gmail.com> >> wrote: >>> >>> As a note of feedback, when I do a spec --help, I saw this line... >>> >>> ? -e, --example [NAME|FILE_NAME] ? Execute example(s) with matching >>> name(s). If the argument is >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?the path to an existing file >>> (typically generated by a previous >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?run using --format >>> failing_examples:file.txt), then the examples >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?on each line of that file will be >>> executed. If the file is empty, >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?all examples will be run (as if -- >>> example was not specified). >>> >>> so I, trying to be clever, passed it something to match: >>> >>> E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"the result" >>> >>> >>> Finished in 0.125 seconds >>> >>> 0 examples, 0 failures >>> >>> >>> Passing it the full test name seems to work, however: >>> >>> E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"returns the >>> result of the run_tests method from the forked child" >>> ... >>> >>> Finished in 0.34375 seconds >>> >>> 3 examples, 0 failures >>> >>> >>> Suggestion: >>> >>> rephrase the help as "runs the test whose name equals the one >>> specified" (instead of using the word "matches" which to me somehow >>> meant "regex"), or >>> >>> change the matching to be regex matching (this one is what I would >>> personally prefer--then you don''t have to put full test names on the >>> command line). >>> >>> Thoughts? >> >> Actually, I''m thinking of not supporting this in rspec-2. I personally >> find the line number much more useful, since you can just copy it >> directly from the failure messages to re-run something: >> >> spec path/to/spec.rb:37 > > This is great except when you use macros or other tricks to generate > examples - then there isn''t a 1:1: mapping from line number to example. I > often find it quite annoying to have to quote the whole example description, > so I actually quite like Roger''s idea about using regexp matching.Excellent news for you both. It turns out that the underlying machinery is already in place for this in rspec2''s new runner. Just need to hook it to the command line. But right now, in rspec-core-2.0.0.a2, you can say this in any Ruby that gets loaded (like spec_helper.rb): Rspec::Core.configure do |c| c.filter_run :description => /should match this string/ end Hooking that from the CLI will be pretty simple, so coming soon. Cheers, David> >> WDYT? >> >>> -r >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > cheers, > Matt > > http://mattwynne.net > +447974 430184 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2010-Jan-31 20:51 UTC
[rspec-users] somewhat confused by the help instructions...
On Sat, Jan 30, 2010 at 8:38 AM, David Chelimsky <dchelimsky at gmail.com> wrote:> On Sat, Jan 30, 2010 at 7:31 AM, Matt Wynne <matt at mattwynne.net> wrote: >> >> On 30 Jan 2010, at 06:45, David Chelimsky wrote: >> >>> On Thu, Jan 28, 2010 at 12:54 PM, rogerdpack <rogerpack2005 at gmail.com> >>> wrote: >>>> >>>> As a note of feedback, when I do a spec --help, I saw this line... >>>> >>>> ? -e, --example [NAME|FILE_NAME] ? Execute example(s) with matching >>>> name(s). If the argument is >>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?the path to an existing file >>>> (typically generated by a previous >>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?run using --format >>>> failing_examples:file.txt), then the examples >>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?on each line of that file will be >>>> executed. If the file is empty, >>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?all examples will be run (as if -- >>>> example was not specified). >>>> >>>> so I, trying to be clever, passed it something to match: >>>> >>>> E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"the result" >>>> >>>> >>>> Finished in 0.125 seconds >>>> >>>> 0 examples, 0 failures >>>> >>>> >>>> Passing it the full test name seems to work, however: >>>> >>>> E:\dev\ruby\spork>spec spec/spork/run_strategy/single* -e"returns the >>>> result of the run_tests method from the forked child" >>>> ... >>>> >>>> Finished in 0.34375 seconds >>>> >>>> 3 examples, 0 failures >>>> >>>> >>>> Suggestion: >>>> >>>> rephrase the help as "runs the test whose name equals the one >>>> specified" (instead of using the word "matches" which to me somehow >>>> meant "regex"), or >>>> >>>> change the matching to be regex matching (this one is what I would >>>> personally prefer--then you don''t have to put full test names on the >>>> command line). >>>> >>>> Thoughts? >>> >>> Actually, I''m thinking of not supporting this in rspec-2. I personally >>> find the line number much more useful, since you can just copy it >>> directly from the failure messages to re-run something: >>> >>> spec path/to/spec.rb:37 >> >> This is great except when you use macros or other tricks to generate >> examples - then there isn''t a 1:1: mapping from line number to example. I >> often find it quite annoying to have to quote the whole example description, >> so I actually quite like Roger''s idea about using regexp matching. > > Excellent news for you both. It turns out that the underlying > machinery is already in place for this in rspec2''s new runner. Just > need to hook it to the command line. But right now, in > rspec-core-2.0.0.a2, you can say this in any Ruby that gets loaded > (like spec_helper.rb): > > Rspec::Core.configure do |c| > ?c.filter_run :description => /should match this string/ > end > > Hooking that from the CLI will be pretty simple, so coming soon.Done: http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature> > Cheers, > David > >> >>> WDYT? >>> >>>> -r >>>> >>>> _______________________________________________ >>>> rspec-users mailing list >>>> rspec-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/rspec-users >>>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >> >> cheers, >> Matt >> >> http://mattwynne.net >> +447974 430184 >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> >
Phillip Koebbe
2010-Jan-31 21:55 UTC
[rspec-users] somewhat confused by the help instructions...
David Chelimsky wrote:> Done: > http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature > >Cool stuff! Does that match the describe groups as well? I would like to be able to run all of the examples in either "first group" or "second group". Will it match? Phillip
Rick DeNatale
2010-Jan-31 22:21 UTC
[rspec-users] somewhat confused by the help instructions...
On Sun, Jan 31, 2010 at 4:55 PM, Phillip Koebbe <phillipkoebbe at gmail.com> wrote:> > > David Chelimsky wrote: >> >> Done: >> >> http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature >> >> > > Cool stuff! > > Does that match the describe groups as well? I would like to be able to run > all of the examples in either "first group" or "second group". Will it > match?Also, does anyone but me find the expectation in the case where there''s no match surprising? -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale
David Chelimsky
2010-Jan-31 22:58 UTC
[rspec-users] somewhat confused by the help instructions...
On Sun, Jan 31, 2010 at 3:55 PM, Phillip Koebbe <phillipkoebbe at gmail.com> wrote:> David Chelimsky wrote: >> >> Done: >> >> http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature > > Cool stuff! > > Does that match the describe groups as well? I would like to be able to run > all of the examples in either "first group" or "second group". Will it > match?Yes. I added some narrative text to explain: http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature
Phillip Koebbe
2010-Jan-31 23:28 UTC
[rspec-users] somewhat confused by the help instructions...
Rick DeNatale wrote:> On Sun, Jan 31, 2010 at 4:55 PM, Phillip Koebbe<phillipkoebbe at gmail.com> wrote: > >> David Chelimsky wrote: >> >>> Done: >>> >>> http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature >>> >>> >>> >> Cool stuff! >> >> Does that match the describe groups as well? I would like to be able to run >> all of the examples in either "first group" or "second group". Will it >> match? >> > > Also, does anyone but me find the expectation in the case where > there''s no match surprising? > >I thought about that, as well. I would expect nothing to be done if no match was found. Consider the case of misspelling the example or group and having the whole shebang run instead of nothing. Peace, Phillip
David Chelimsky
2010-Feb-01 02:08 UTC
[rspec-users] somewhat confused by the help instructions...
On Sun, Jan 31, 2010 at 5:28 PM, Phillip Koebbe <phillipkoebbe at gmail.com> wrote:> > Rick DeNatale wrote: >> >> On Sun, Jan 31, 2010 at 4:55 PM, Phillip Koebbe<phillipkoebbe at gmail.com> >> ?wrote: >> >>> >>> David Chelimsky wrote: >>> >>>> >>>> Done: >>>> >>>> >>>> http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature >>>> >>>> >>>> >>> >>> Cool stuff! >>> >>> Does that match the describe groups as well? I would like to be able to >>> run >>> all of the examples in either "first group" or "second group". Will it >>> match? >>> >> >> Also, does anyone but me find the expectation in the case where >> there''s no match surprising? >> >> > > I thought about that, as well. I would expect nothing to be done if no match > was found. Consider the case of misspelling the example or group and having > the whole shebang run instead of nothing.Agreed: http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature> > Peace, > Phillip
Phillip Koebbe
2010-Feb-01 14:53 UTC
[rspec-users] somewhat confused by the help instructions...
David Chelimsky wrote:> Agreed: > > http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.featureThanks, David. I don''t want to sound all gushy or anything, but you have got to be one of the most helpful, courteous, knowledgable people I have encountered in all my days on the internet. Thanks for all that you do for all the communities you participate in. Peace, Phillip
Matt Wynne
2010-Feb-01 16:20 UTC
[rspec-users] somewhat confused by the help instructions...
On 1 Feb 2010, at 14:53, Phillip Koebbe wrote:> > > David Chelimsky wrote: >> Agreed: >> >> http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature > > Thanks, David. > > I don''t want to sound all gushy or anything, but you have got to be > one of the most helpful, courteous, knowledgable people I have > encountered in all my days on the internet.+1> > Thanks for all that you do for all the communities you participate in. > > Peace, > Phillip > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-userscheers, Matt http://mattwynne.net +447974 430184
Rick DeNatale
2010-Feb-01 19:36 UTC
[rspec-users] somewhat confused by the help instructions...
On Mon, Feb 1, 2010 at 9:53 AM, Phillip Koebbe <phillipkoebbe at gmail.com> wrote:> I don''t want to sound all gushy or anything, but you have got to be one of > the most helpful, courteous, knowledgable people I have encountered in all > my days on the internet.Not to mention that he plays a mean guitar! -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale
Joseph Wilk
2010-Feb-01 20:07 UTC
[rspec-users] somewhat confused by the help instructions...
On 01/02/2010 16:20, Matt Wynne wrote:> > On 1 Feb 2010, at 14:53, Phillip Koebbe wrote: > >> >> >> David Chelimsky wrote: >>> Agreed: >>> >>> http://github.com/rspec/rspec-core/blob/master/features/command_line/example_name_option.feature >>> >> >> Thanks, David. >> >> I don''t want to sound all gushy or anything, but you have got to be >> one of the most helpful, courteous, knowledgable people I have >> encountered in all my days on the internet. > > +1+ 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000^100000000000000000000000> >> >> Thanks for all that you do for all the communities you participate in. >> >> Peace, >> Phillip >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > cheers, > Matt > > http://mattwynne.net > +447974 430184 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >