Hi guys, Apologies if this is a dumb question. I''m new to rails and most of the information online is about rails 2 and rspec 1.3, but my group is using rails 3 and thus rspec 2. I''m trying to format the output of rake spec, and I found online that I could use options like --format html in a file called spec/spec.opts in the rails base directory. However, from my attempts to populate this file and my cursory search through the rspec2 source, I don''t think it obeys this file anymore. Furthermore, it seems like there is no more html format yet (makes sense, if rspec2 is a complete rewrite). So my question is, is there any way for me to a) specify options to be used when running rake spec and b) format the output nicely, specifically in html format but any alternative to the default is fine. The goal is basically to have the test results emailed out to the web development team each time someone pushes to git. I''ve got the rest of the script working, I just want to make it prettier. Thanks! -Ibrahim
On Jul 1, 2010, at 11:13 AM, Ibrahim Awwal wrote:> Hi guys, > Apologies if this is a dumb question. I''m new to rails and most of the > information online is about rails 2 and rspec 1.3, but my group is > using rails 3 and thus rspec 2. I''m trying to format the output of > rake spec, and I found online that I could use options like --format > html in a file called spec/spec.opts in the rails base directory. > However, from my attempts to populate this file and my cursory search > through the rspec2 source, I don''t think it obeys this file anymore. > Furthermore, it seems like there is no more html format yet (makes > sense, if rspec2 is a complete rewrite). So my question is, is there > any way for me to a) specify options to be used when running rake spec > and b) format the output nicely, specifically in html format but any > alternative to the default is fine. > > The goal is basically to have the test results emailed out to the web > development team each time someone pushes to git. I''ve got the rest of > the script working, I just want to make it prettier. Thanks!HTML and TextMate formatters have yet to be added, but their on the list: http://github.com/rspec/rspec-core/issues. Cheers, David
On Jul 1, 9:13?am, Ibrahim Awwal <ibrahim.aw... at gmail.com> wrote:> Hi guys, > Apologies if this is a dumb question. I''m new to rails and most of the > information online is about rails 2 and rspec 1.3, but my group is > using rails 3 and thus rspec 2. I''m trying to format the output of > rake spec, and I found online that I could use options like --format > html in a file called spec/spec.opts in the rails base directory. > However, from my attempts to populate this file and my cursory search > through the rspec2 source, I don''t think it obeys this file anymore. > Furthermore, it seems like there is no more html format yet (makes > sense, if rspec2 is a complete rewrite). So my question is, is there > any way for me to a) specify options to be used when running rake spec > and b) format the output nicely, specifically in html format but any > alternative to the default is fine. > > The goal is basically to have the test results emailed out to the web > development team each time someone pushes to git. I''ve got the rest of > the script working, I just want to make it prettier. Thanks! > > -IbrahimD''oh, I guess it was a dumb question. Searched this group and I found out that the proper file is now .rspec. Also found the answer on the formatters, looks like right now there''s only documentation and progress formats? That''s probably fine, I''ll likely switch to documentation format because it''s less verbose which is nicer for email. I''m still wondering one thing though, is it possible to disable colored output from a command line option? It seems like before you could pass --no-color but I''m not sure whether that''s still the case now (I don''t have access to my codebase right now so I can''t test it myself). The reason being that right now when I redirect the output of rake spec into a file (rake spec > $tmp where tmp=`mktemp`) I get all the bash color escape sequences in the file, which is pretty useless for email. Thanks! -Ibrahim
On Jul 1, 9:25?am, David Chelimsky <dchelim... at gmail.com> wrote:> On Jul 1, 2010, at 11:13 AM, Ibrahim Awwal wrote: > > > > > Hi guys, > > Apologies if this is a dumb question. I''m new to rails and most of the > > information online is about rails 2 and rspec 1.3, but my group is > > using rails 3 and thus rspec 2. I''m trying to format the output of > > rake spec, and I found online that I could use options like --format > > html in a file called spec/spec.opts in the rails base directory. > > However, from my attempts to populate this file and my cursory search > > through the rspec2 source, I don''t think it obeys this file anymore. > > Furthermore, it seems like there is no more html format yet (makes > > sense, if rspec2 is a complete rewrite). So my question is, is there > > any way for me to a) specify options to be used when running rake spec > > and b) format the output nicely, specifically in html format but any > > alternative to the default is fine. > > > The goal is basically to have the test results emailed out to the web > > development team each time someone pushes to git. I''ve got the rest of > > the script working, I just want to make it prettier. Thanks! > > HTML and TextMate formatters have yet to be added, but their on the list: > > http://github.com/rspec/rspec-core/issues. > > Cheers, > DavidThanks, that is helpful. Does the --no-color option work? I just installed rspec on my work computer and it seems to work but I just want to be sure, because it doesn''t seem like it''s there in the option parsing code, but I don''t know how optparse works in ruby. Right now I have the output being fed into a perl script which strips the escape codes out but if I can get rid of that step it would be nice. -Ibrahim
On Jul 1, 2010, at 11:41 AM, Ibrahim Awwal wrote:> On Jul 1, 9:25 am, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jul 1, 2010, at 11:13 AM, Ibrahim Awwal wrote: >> >> >> >>> Hi guys, >>> Apologies if this is a dumb question. I''m new to rails and most of the >>> information online is about rails 2 and rspec 1.3, but my group is >>> using rails 3 and thus rspec 2. I''m trying to format the output of >>> rake spec, and I found online that I could use options like --format >>> html in a file called spec/spec.opts in the rails base directory. >>> However, from my attempts to populate this file and my cursory search >>> through the rspec2 source, I don''t think it obeys this file anymore. >>> Furthermore, it seems like there is no more html format yet (makes >>> sense, if rspec2 is a complete rewrite). So my question is, is there >>> any way for me to a) specify options to be used when running rake spec >>> and b) format the output nicely, specifically in html format but any >>> alternative to the default is fine. >> >>> The goal is basically to have the test results emailed out to the web >>> development team each time someone pushes to git. I''ve got the rest of >>> the script working, I just want to make it prettier. Thanks! >> >> HTML and TextMate formatters have yet to be added, but their on the list: >> >> http://github.com/rspec/rspec-core/issues. >> >> Cheers, >> David > > Thanks, that is helpful. Does the --no-color option work? I just > installed rspec on my work computer and it seems to work but I just > want to be sure, because it doesn''t seem like it''s there in the option > parsing code, but I don''t know how optparse works in ruby. Right now I > have the output being fed into a perl script which strips the escape > codes out but if I can get rid of that step it would be nice.Check out what we do in rspec-core''s own spec_helper: http://github.com/rspec/rspec-core/blob/master/spec/spec_helper.rb
On Jul 1, 11:06?am, David Chelimsky <dchelim... at gmail.com> wrote:> On Jul 1, 2010, at 11:41 AM, Ibrahim Awwal wrote: > > > > > On Jul 1, 9:25 am, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Jul 1, 2010, at 11:13 AM, Ibrahim Awwal wrote: > > >>> Hi guys, > >>> Apologies if this is a dumb question. I''m new to rails and most of the > >>> information online is about rails 2 and rspec 1.3, but my group is > >>> using rails 3 and thus rspec 2. I''m trying to format the output of > >>> rake spec, and I found online that I could use options like --format > >>> html in a file called spec/spec.opts in the rails base directory. > >>> However, from my attempts to populate this file and my cursory search > >>> through the rspec2 source, I don''t think it obeys this file anymore. > >>> Furthermore, it seems like there is no more html format yet (makes > >>> sense, if rspec2 is a complete rewrite). So my question is, is there > >>> any way for me to a) specify options to be used when running rake spec > >>> and b) format the output nicely, specifically in html format but any > >>> alternative to the default is fine. > > >>> The goal is basically to have the test results emailed out to the web > >>> development team each time someone pushes to git. I''ve got the rest of > >>> the script working, I just want to make it prettier. Thanks! > > >> HTML and TextMate formatters have yet to be added, but their on the list: > > >>http://github.com/rspec/rspec-core/issues. > > >> Cheers, > >> David > > > Thanks, that is helpful. Does the --no-color option work? I just > > installed rspec on my work computer and it seems to work but I just > > want to be sure, because it doesn''t seem like it''s there in the option > > parsing code, but I don''t know how optparse works in ruby. Right now I > > have the output being fed into a perl script which strips the escape > > codes out but if I can get rid of that step it would be nice. > > Check out what we do in rspec-core''s own spec_helper: > > http://github.com/rspec/rspec-core/blob/master/spec/spec_helper.rbAh I see, thanks very much! I''ve been very surprised and amazed by the help you''ve given me. Apologies for the double post, the first one went into the moderation queue because I didn''t see the thing about registering on mailman as well but after I did that I posted again because I assumed that the other one just wouldn''t get approved. -Ibrahim