I''ve tried running Heckle with rspec on some of my classes, but keep getting (what I believe to be) an infinite recursion. Is there some way to supply extra options to heckle via. rspec? Scott
On 8/15/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > I''ve tried running Heckle with rspec on some of my classes, but keep > getting (what I believe to be) an infinite recursion. Is there some > way to supply extra options to heckle via. rspec? >Currently not. What options do you want to supply? Aslak> Scott > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On Aug 15, 2007, at 7:57 AM, aslak hellesoy wrote:> On 8/15/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: >> >> I''ve tried running Heckle with rspec on some of my classes, but keep >> getting (what I believe to be) an infinite recursion. Is there some >> way to supply extra options to heckle via. rspec? >> > > Currently not. What options do you want to supply?Well right now the only one I care about is --verbose, but depending on the output of --verbose, I may want other options (probably -- assignments and --branches). Thanks, Scott
On Aug 15, 2007, at 8:11 AM, Scott Taylor wrote:> > On Aug 15, 2007, at 7:57 AM, aslak hellesoy wrote: > >> On 8/15/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: >>> >>> I''ve tried running Heckle with rspec on some of my classes, but keep >>> getting (what I believe to be) an infinite recursion. Is there some >>> way to supply extra options to heckle via. rspec? >>> >> >> Currently not. What options do you want to supply? > > Well right now the only one I care about is --verbose, but depending > on the output of --verbose, I may want other options (probably -- > assignments and --branches). >I can probably work up a patch for this one. Thanks for the info, Aslak. Scott
On Aug 15, 2007, at 7:57 AM, aslak hellesoy wrote:> On 8/15/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote: >> >> I''ve tried running Heckle with rspec on some of my classes, but keep >> getting (what I believe to be) an infinite recursion. Is there some >> way to supply extra options to heckle via. rspec? >> > > Currently not. What options do you want to supply? > > AslakAslak, What would be the best format for heckle options (through OptionParser) via the spec-command? Scott
What would be the best format for heckle options (through> OptionParser) via the spec-command?When we discussed this a few months back I proposed something like: One alternative I thought of is to have a standard way to "promote" options to other tools that spec invokes. Along the lines of: spec --heckle --options-heckle "--verbose --branches MyModule::MyClass#my_method" ... and the argument to --options-heckle (or --options-rcov etc) would simply be passed along in the call to heckle. This would cover more situations with a single solution. /Robert Feldt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070819/bd8b80da/attachment-0001.html
On Aug 19, 2007, at 2:05 AM, Robert Feldt wrote:> > > What would be the best format for heckle options (through > OptionParser) via the spec-command? > > When we discussed this a few months back I proposed something like: > > > One alternative I thought of is to have a standard way to "promote" > options to other tools that spec invokes. Along the lines of: > > spec --heckle --options-heckle "--verbose --branches > MyModule::MyClass#my_method" ... > > and the argument to --options-heckle (or --options-rcov etc) would > simply be passed along in the call to heckle. This would cover more > situations with a single solution. >I''ve cooked up a patch for a tiny-little recursive parser in the command line parsing to deal with the promotion of options, so that you could do something like this: spec --heckle "MyClass --verbose --timeout 10" So far only the --verbose and --timeout options are used (and I''m not sure that they are even working yet, since I haven''t used heckle on anything but an rspec project). I haven''t worked more on the patch because I figured it would get rejected for the added complexity in command line parsing of arguments. Robert: Maybe if you would like to take a look at my changes, I could email you what I have so far, and we could divide up work on the rest of the heckle options. So far I have two, and there are only 8 or so, and at this point most of them look pretty trivial to implement. Scott
> > One alternative I thought of is to have a standard way to "promote" > > options to other tools that spec invokes. Along the lines of: > > > > spec --heckle --options-heckle "--verbose --branches > > MyModule::MyClass#my_method" ... > > > > and the argument to --options-heckle (or --options-rcov etc) would > > simply be passed along in the call to heckle. This would cover more > > situations with a single solution. > > > > I''ve cooked up a patch for a tiny-little recursive parser in the > command line parsing to deal with the promotion of options, so that > you could do something like this: > > spec --heckle "MyClass --verbose --timeout 10" > > So far only the --verbose and --timeout options are used (and I''m not > sure that they are even working yet, since I haven''t used heckle on > anything but an rspec project). > > I haven''t worked more on the patch because I figured it would get > rejected for the added complexity in command line parsing of arguments. > > Robert: Maybe if you would like to take a look at my changes, I could > email you what I have so far, and we could divide up work on the rest > of the heckle options. So far I have two, and there are only 8 or > so, and at this point most of them look pretty trivial to implement.But why do you need to parse the contents of the string with the options that should be passed onto heckle? The idea is that it should simply be passed on. I''m probably missing something... ;) /Robert Scott> > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Best regards, /Robert Feldt -- PhD, Assistant Professor in Software Engineering Blekinge Institute of Technology School of Engineering (APS) SE-372 25 Ronneby Sweden Phone: +46 (0) 457 385 887 Mobile: +46 (0) 733 580 580 Web pages: Research group: http://www.bth.se/tek/serl/ Research project: http://www.bth.se/besq/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070819/5ad76b88/attachment.html
On Aug 19, 2007, at 2:52 AM, Robert Feldt wrote:> > > One alternative I thought of is to have a standard way to "promote" > > options to other tools that spec invokes. Along the lines of: > > > > spec --heckle --options-heckle "--verbose --branches > > MyModule::MyClass#my_method" ... > > > > and the argument to --options-heckle (or --options-rcov etc) would > > simply be passed along in the call to heckle. This would cover more > > situations with a single solution. > > > > I''ve cooked up a patch for a tiny-little recursive parser in the > command line parsing to deal with the promotion of options, so that > you could do something like this: > > spec --heckle "MyClass --verbose --timeout 10" > > So far only the --verbose and --timeout options are used (and I''m not > sure that they are even working yet, since I haven''t used heckle on > anything but an rspec project). > > I haven''t worked more on the patch because I figured it would get > rejected for the added complexity in command line parsing of > arguments. > > Robert: Maybe if you would like to take a look at my changes, I could > email you what I have so far, and we could divide up work on the rest > of the heckle options. So far I have two, and there are only 8 or > so, and at this point most of them look pretty trivial to implement. > > But why do you need to parse the contents of the string with the > options that should be passed onto heckle? The idea is that it > should simply be passed on. I''m probably missing something... ;)Well - parsing in two regards: 1. On the command line, so that Ruby''s OptionParser doesn''t think that a "--verbose" is a command to rspec. This alone isn''t really an issue until you factor in spec.opts, which is read in as a string (so some detection of escaping must occur). 2. So that it can be used by the RSpec wrapper to Heckle. Heckle has a base Heckle class, as well as a TestUnitHeckler class, which descends from the Heckle class. All Hecker''s (the command you run, not the class) option parser does is set some default class variables in the two classes (Heckle & TestUnitHeckler), so some of those class level setters would need to be changed, anyway. This would probably be clearer just by looking at the code for heckle + the relevant code in rspec. Scott