Cody P. Skidmore
2007-Aug-17 14:09 UTC
[rspec-users] RSpec --format --html:/path/to/file.html
Greetings everyone. I''m learning RSpec and am pretty fresh to Ruby/Rails, but am so excited I can''t help jumping in. I''m running before I can walk here. :-) Yesterday I tried outputting test results to HTML instead of colorized plain text. It looked like there were some entries in the change log for the 1.0.5 release allowing RSpec to do what I wanted. I tried adding a setting to spec.opts but it didn''t work to say the least. Here''s the change log entry: * The --out option is gone. Use --format html:path/to/my.html instead (or similar). 1. Does this do what I think it should? 2. where can I find documentation on using spec.opts? The command line help doesn''t mention a "--format" option. It looks like CI::Reporter [could] output XML format but can it be used independently? I''m mining the documentation for related information but didn''t find it so far. Thank you for your help in advance.
David Chelimsky
2007-Aug-18 05:59 UTC
[rspec-users] RSpec --format --html:/path/to/file.html
On 8/17/07, Cody P. Skidmore <cody at skidmore.us> wrote:> Greetings everyone. I''m learning RSpec and am pretty fresh to Ruby/Rails, > but am so excited I can''t help jumping in. I''m running before I can walk > here. :-) > > Yesterday I tried outputting test results to HTML instead of colorized > plain text. It looked like there were some entries in the change log for > the 1.0.5 release allowing RSpec to do what I wanted. > > I tried adding a setting to spec.opts but it didn''t work to say the least. > Here''s the change log entry: > > * The --out option is gone. Use --format html:path/to/my.html instead (or > similar). > > 1. Does this do what I think it should?In spec.opts, each line represents one command line arg, so you''d have to do this (on two separate lines): --format html:/path/to/my.html Then on the command line: spec spec -O path/to/spec.opts> 2. where can I find documentation on using spec.opts? The command line > help doesn''t mention a "--format" option.Look at http://rspec.rubyforge.org/documentation/tools/spec.html. If you scroll down you''ll see the output from the spec command. It definitely mentions the --format option.> It looks like CI::Reporter [could] output XML format but can it be used > independently? > > I''m mining the documentation for related information but didn''t find it so > far. > > Thank you for your help in advance. > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On Aug 18, 2007, at 1:59 AM, David Chelimsky wrote:> On 8/17/07, Cody P. Skidmore <cody at skidmore.us> wrote: >> Greetings everyone. I''m learning RSpec and am pretty fresh to >> Ruby/Rails, >> but am so excited I can''t help jumping in. I''m running before I >> can walk >> here. :-) >> >> Yesterday I tried outputting test results to HTML instead of >> colorized >> plain text. It looked like there were some entries in the change >> log for >> the 1.0.5 release allowing RSpec to do what I wanted. >> >> I tried adding a setting to spec.opts but it didn''t work to say >> the least. >> Here''s the change log entry: >> >> * The --out option is gone. Use --format html:path/to/my.html >> instead (or >> similar). >> >> 1. Does this do what I think it should? > > > In spec.opts, each line represents one command line arg, so you''d have > to do this (on two separate lines): >Actually you can combine then in any way you choose. This would work as well: --format html:/foo/bar> --format > html:/path/to/my.html > > Then on the command line: > > spec spec -O path/to/spec.opts > >> 2. where can I find documentation on using spec.opts? The >> command line >> help doesn''t mention a "--format" option. > > Look at http://rspec.rubyforge.org/documentation/tools/spec.html. If > you scroll down you''ll see the output from the spec command. It > definitely mentions the --format option. > > >> It looks like CI::Reporter [could] output XML format but can it be >> used >> independently? >> >> I''m mining the documentation for related information but didn''t >> find it so >> far.If you really wanted to dump to XML, I''m sure you could build your own formatter. Check out the different defaults ones which come with rspec, under trunk/rspec/lib/spec/runner/formatter/ Scott
Cody P. Skidmore
2007-Aug-20 15:04 UTC
[rspec-users] RSpec --format --html:/path/to/file.html
Scott Taylor wrote:> Actually you can combine then in any way you choose. This would work > as well: > > --format html:/foo/bar > >> --format >> html:/path/to/my.html >> >> Then on the command line: >> >> spec spec -O path/to/spec.optsI was hesitant to bring this up again, but I couldn''t run it as you described. I''m running on Windows XP Pro instead of Linux or OSX, BTW. When I shell out and execute it like this for example: spec spec -O spec\spec.opts OR rake spec It crashes and dumps a callstack out. However, if it is run like this: spec spec --format html:c:\temp\testing.html the tests run just fine outputting the results as expected. If you''d like, I can run it using --trace and post the callstack for you to look at along with my spec.opts file. It seems straight-forward to use RSpec as described. I haven''t had much success running specs using spec.opts though. The same error occurs using the Rake task or passing the options. With Regards, Cody
aslak hellesoy
2007-Aug-20 16:25 UTC
[rspec-users] RSpec --format --html:/path/to/file.html
On 8/20/07, Cody P. Skidmore <cody at skidmore.us> wrote:> Scott Taylor wrote: > > Actually you can combine then in any way you choose. This would work > > as well: > > > > --format html:/foo/bar > > > >> --format > >> html:/path/to/my.html > >> > >> Then on the command line: > >> > >> spec spec -O path/to/spec.opts > > > I was hesitant to bring this up again, but I couldn''t run it as you > described. I''m running on Windows XP Pro instead of Linux or OSX, BTW. > > When I shell out and execute it like this for example: > > spec spec -O spec\spec.opts > > OR > > rake spec > > It crashes and dumps a callstack out.Can we see that call stack?> However, if it is run like this: > > spec spec --format html:c:\temp\testing.html > > the tests run just fine outputting the results as expected. If you''d > like, I can run it using --trace and post the callstack for you to look atPlease do. Aslak> along with my spec.opts file. It seems straight-forward to use RSpec as > described. I haven''t had much success running specs using spec.opts > though. The same error occurs using the Rake task or passing the options. > > With Regards, > > Cody > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >