# Ci\_reporter user guide?

**URL:** <https://www.ruby-forum.com/t/ci-reporter-user-guide/109999>\
**Category:** Ruby\
**Created:** [July 21, 2007, 1:30am UTC](https://www.ruby-forum.com/t/ci-reporter-user-guide/109999 "2007-07-21T01:30:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 21, 2007, 1:30am UTC](https://www.ruby-forum.com/t/ci-reporter-user-guide/109999/1 "2007-07-21T01:30:46Z")

</div>

Hi,  
I am new to ruby. I’ve googled for ci\_reporter user guide, but i found  
little helpful results. Could anyone have a clue where i can get support  
for reporter? My real question is how to get xml output ruby. Earlier,  
someone on the forum point me out that ci\_reporter has this  
functionality. ci\_reporter has method called to\_xml, but I don’t really  
know how to use it. Any help would be greatly appreciated.

Thanks,  
maung

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 21, 2007, 8:14am UTC](https://www.ruby-forum.com/t/ci-reporter-user-guide/109999/2 "2007-07-21T08:14:52Z")

</div>

On 7/20/07, Maung A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,  
> I am new to ruby. I’ve googled for ci\_reporter user guide, but i found  
> little helpful results. Could anyone have a clue where i can get support  
> for reporter? My real question is how to get xml output ruby. Earlier,  
> someone on the forum point me out that ci\_reporter has this  
> functionality. ci\_reporter has method called to\_xml, but I don’t really  
> know how to use it. Any help would be greatly appreciated.

First link on google for “ci\_reporter” gets you here:

[http://caldersphere.rubyforge.org/ci\_reporter/](http://caldersphere.rubyforge.org/ci_reporter/)

Please let me know what in the documentation is unclear.

/Nick

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 21, 2007, 8:28am UTC](https://www.ruby-forum.com/t/ci-reporter-user-guide/109999/3 "2007-07-21T08:28:53Z")

</div>

On 7/20/07, Maung A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,  
> I am new to ruby. I’ve googled for ci\_reporter user guide, but i found  
> little helpful results. Could anyone have a clue where i can get support  
> for reporter? My real question is how to get xml output ruby. Earlier,  
> someone on the forum point me out that ci\_reporter has this  
> functionality. ci\_reporter has method called to\_xml, but I don’t really  
> know how to use it. Any help would be greatly appreciated.

Re-reading your question, it sounds like you want a general to\_xml  
method  
for Ruby objects. ci\_reporter does not do this, it’s meant to be used  
with  
your unit tests to generate xml reports (again see doco link). Perhaps  
you  
want to look at the xml serialization code in Rails, which requires you  
to  
use either simple hashes and arrays, or ActiveRecord.

[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000375](http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000375)  
[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Conversions.html#M000361](http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Conversions.html#M000361)  
[http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html#M000910](http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html#M000910)

/Nick

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 23, 2007, 7:51pm UTC](https://www.ruby-forum.com/t/ci-reporter-user-guide/109999/4 "2007-07-23T19:51:01Z")

</div>

Hi Nick,

Thanks for your response. I am very new to ruby, so please bear with me.  
I am using Ruby, Watir and Test/unit, not Ruby on rails.  
My first question will be if i can use ci\_reporter with the tools i  
mentioned above. I found out that I need to use ci\_reporter with Rake.

What I am trying to achieve is that test login a website and check if  
successful. I used test/unit assert to validate the result. I need to  
get the output from running ruby as XML file so that I can use in  
cruisecontrol application. But I don’t know how to use to\_xml method in  
my rake file or ruby.

This is another question. Since I use test/unit, I put the following  
line in my rake file:  
require ‘rubygems’  
gem ‘ci\_reporter’  
require ‘ci/reporter/rake/test\_unit’ # use this if you’re using  
Test::Unit  
according to the documentation. When try to run it, I got this error  
message:  
c:/ruby/lib/ruby/gems/1.8/gems/ci\_reporter-1.3.3/lib/ci/reporter/rake/test\_unit.rb:5:  
undefined method `namespace' for main:Object (NoMethodError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require’  
from Rakefile.rb:3  
I don’t really know what is causing it.

Any help would be very appreciated.

Thanks,  
maung

Nick S. wrote:

> On 7/20/07, Maung A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hi,  
> > I am new to ruby. I’ve googled for ci\_reporter user guide, but i found  
> > little helpful results. Could anyone have a clue where i can get support  
> > for reporter? My real question is how to get xml output ruby. Earlier,  
> > someone on the forum point me out that ci\_reporter has this  
> > functionality. ci\_reporter has method called to\_xml, but I don’t really  
> > know how to use it. Any help would be greatly appreciated.
> 
> Re-reading your question, it sounds like you want a general to\_xml  
> method  
> for Ruby objects. ci\_reporter does not do this, it’s meant to be used  
> with  
> your unit tests to generate xml reports (again see doco link). Perhaps  
> you  
> want to look at the xml serialization code in Rails, which requires you  
> to  
> use either simple hashes and arrays, or ActiveRecord.
> 
> [http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000375](http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000375)  
> [http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Conversions.html#M000361](http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Conversions.html#M000361)  
> [http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html#M000910](http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html#M000910)
> 
> /Nick

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [July 27, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/ci-reporter-user-guide/109999/5 "2007-07-27T23:01:51Z")

</div>

I have the exact same issue…

1. Ruby 1.8.2-15, Watir-1.5.1192, ci\_reporter 1.3.3
2. My tests are based on Watir::TestCase
3. I am able to run a simple test and generate XML output

How does one generate a stylesheet to display an HTML report?

\<file: tc1.rb\>  
require ‘watir’  
require ‘watir/testcase’  
require ‘ci/reporter/rake/test\_unit\_loader’  
require ‘test/unit/ui/console/testrunner’

class TC\_MyTests \< Watir::TestCase  
def test\_mytest1  
assert(true, “Test passed”)  
end

def test\_mytest2  
assert(false, “Test failed”)  
end  
end

\<?xml version="1.0" encoding="UTF-8"?\> Test failed. \<false\> is not true. (Test::Unit::AssertionFailedError) tc1.rb:12:in `test\_mytest2' 

Maung A. wrote:

> Hi Nick,
> 
> Thanks for your response. I am very new to ruby, so please bear with me.  
> I am using Ruby, Watir and Test/unit, not Ruby on rails.  
> My first question will be if i can use ci\_reporter with the tools i  
> mentioned above. I found out that I need to use ci\_reporter with Rake.
> 
> What I am trying to achieve is that test login a website and check if  
> successful. I used test/unit assert to validate the result. I need to  
> get the output from running ruby as XML file so that I can use in  
> cruisecontrol application. But I don’t know how to use to\_xml method in  
> my rake file or ruby.
> 
> This is another question. Since I use test/unit, I put the following  
> line in my rake file:  
> require ‘rubygems’  
> gem ‘ci\_reporter’  
> require ‘ci/reporter/rake/test\_unit’ # use this if you’re using  
> Test::Unit  
> according to the documentation. When try to run it, I got this error  
> message:  
> c:/ruby/lib/ruby/gems/1.8/gems/ci\_reporter-1.3.3/lib/ci/reporter/rake/test\_unit.rb:5:  
> undefined method `namespace' for main:Object (NoMethodError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
> from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> `require’  
> from Rakefile.rb:3  
> I don’t really know what is causing it.
> 
> Any help would be very appreciated.
> 
> Thanks,  
> maung
> 
> Nick S. wrote:
> 
> > On 7/20/07, Maung A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > Hi,  
> > > I am new to ruby. I’ve googled for ci\_reporter user guide, but i found  
> > > little helpful results. Could anyone have a clue where i can get support  
> > > for reporter? My real question is how to get xml output ruby. Earlier,  
> > > someone on the forum point me out that ci\_reporter has this  
> > > functionality. ci\_reporter has method called to\_xml, but I don’t really  
> > > know how to use it. Any help would be greatly appreciated.
> > 
> > Re-reading your question, it sounds like you want a general to\_xml  
> > method  
> > for Ruby objects. ci\_reporter does not do this, it’s meant to be used  
> > with  
> > your unit tests to generate xml reports (again see doco link). Perhaps  
> > you  
> > want to look at the xml serialization code in Rails, which requires you  
> > to  
> > use either simple hashes and arrays, or ActiveRecord.
> > 
> > [http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000375](http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000375)  
> > [http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Conversions.html#M000361](http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Hash/Conversions.html#M000361)  
> > [http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html#M000910](http://api.rubyonrails.org/classes/ActiveRecord/XmlSerialization.html#M000910)
> > 
> > /Nick
