Re: [Wtr-general] Test::Unit Reports?

2006-06-09 Thread polleu
Hi there,

I had the same problem.

To fix it I import:

require 'test/unit/testsuite'
require 'test/unit/testsuite'
require 'test/unit/ui/reporter'
require 'fileutils'
require 'test/unit/collector/objectspace'
.

In my setup file ( I have a setup file defined which is called by all
test suit files I additionally require the following:

require 'watir'
require 'test/unit'
require 'test/unit/ui/reporter'
require 'test/unit/ui/console/testrunner'
require 'stringio'
require 'fileutils'
require 'test/unit/assertions'
require 'watir/testUnitAddons'

and this seems to have fixed the error.

Hope it helps.

Ulrike

On 08.06.2006 at 17:22, you wrote:

 Hi,

 Thanks for getting back to me.

 This is where I am with comments

 #require 'test/unit' #I was under the impression that this would
 automatically import the two requires below
 require 'test/unit/ui/reporter'
 require 'test/unit/ui/console/testrunner'
 require 'tc_1'
 require 'tc_2'

  class TS_MyTests
   suite = Test::Unit::TestSuite.new

suite  TC_1.suite
suite  TC_2.suite

#Dir.mkdir('build/report') #says file exists
require 'fileutils'
FileUtils.mkdir_p 'build/report'

#I tried this:
#Reporter.new.run(suite, 'build/report')
#think it's trying to run the below method from this class

Test::Unit::UI::Reporter.run(suite, 'build/report')
  end


  The problem I have is with this line:

  Test::Unit::UI::Reporter.run(suite, 'build/report')

  I am told it is an uninitialized constant

  Test::Unit::UI::Reporter::StringIO (NameError)

  Thanks

  Aidy




---
 This message and any attachment are confidential and may be privileged
or otherwise protected from disclosure.
 If you are not the intended recipient, please telephone or email the
sender and delete this message and any attachment from your system.
 If you are not the intended recipient you must not copy this message
or attachment or disclose the contents to any other person.

---
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general





___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Test::Unit Reports?

2006-06-09 Thread Adrian Rutter
polleu wrote
 I had the same problem.

Just this second, I was going to post back. I included this

require 'stringio'

(as someone did mention), and the code ran.

code example:

snip
require 'test/unit'
require 'test/unit/ui/reporter'
require 'test/unit/ui/console/testrunner'
require 'stringio'

require 'tc_1'
require 'tc_2'

 class TS_MyTests
  suite = Test::Unit::TestSuite.new

   suite  TC_1.suite
   suite  TC_2.suite

   require 'fileutils'
   FileUtils.mkdir_p 'build/report'

   Test::Unit::UI::Reporter.run(suite, '.\build\report')
 end
snip

I certainly like the style of the HTML reports. You can log to xml as well,
so if I have some time, I'll write some XSLT so we can have a 'fuller'
report.

Aidy




---
This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. 
If you are not the intended recipient, please telephone or email the sender and 
delete this message and any attachment from your system.  
If you are not the intended recipient you must not copy this message or 
attachment or disclose the contents to any other person.
---
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Test::Unit Reports?

2006-06-08 Thread Lillis, Dara
two obvious problems: 

you need to require reporter:
require 'test/unit/ui/reporter' 

and you should require (and add to the suite) the class TC_1, not the
test method tc_1

as an aside, you can create your directory without requiring fileutils
using this single line:
Dir.mkdir('build/report')

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Rutter
Sent: Thursday, June 08, 2006 10:33 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Test::Unit Reports?


Hi,

Please forgive my ignorance of unit test suites

I have successfully installed Test::Unit::Reporter in my Ruby folder

 ruby setup.rb config
 ruby setup.rb install

I have created two unit tests that are exactly the same apart from their
class and method name class TC_1  def test_tc_1 class TC_2  def
test_tc_2

require 'test/unit'

class TC_1  Test::Unit::TestCase
def test_tc_1
  start_browser('http://gbahevm07l15:9081/wps/portal')
  assert($ie.contains_text('Welcome'))
  $ie.close
end

end


This is an attempt to create a unit test suite

require 'test/unit'
require 'tc_1'
require 'tc_2'

 class TS_MyTests
  suite = Test::Unit::TestSuite.new

   suite  tc_1.suite
   suite  tc_2.suite

   require 'fileutils'
   FileUtils.mkdir_p 'build/report'
   Test::Unit::UI::Reporter.run(suite, 'build/report')  end

 The errors I am receiving are:

 undefined local variable or method `tc_1' for TS_MyTests:Class
(NameError)
 uninitialized constant Test::Unit::UI::Reporter (NameError)

 Can anyone please point me in the right direction?

 Thank You
 Aidy




---
This message and any attachment are confidential and may be privileged
or otherwise protected from disclosure. 
If you are not the intended recipient, please telephone or email the
sender and delete this message and any attachment from your system.  
If you are not the intended recipient you must not copy this message or
attachment or disclose the contents to any other person.

---
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Test::Unit Reports?

2006-06-08 Thread Lillis, Dara
oops, forgot to mention you also need this require:

require 'test/unit/ui/console/testrunner' 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lillis, Dara
Sent: Thursday, June 08, 2006 10:51 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Test::Unit Reports?

two obvious problems: 

you need to require reporter:
require 'test/unit/ui/reporter' 

and you should require (and add to the suite) the class TC_1, not the
test method tc_1

as an aside, you can create your directory without requiring fileutils
using this single line:
Dir.mkdir('build/report')

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Rutter
Sent: Thursday, June 08, 2006 10:33 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Test::Unit Reports?


Hi,

Please forgive my ignorance of unit test suites

I have successfully installed Test::Unit::Reporter in my Ruby folder

 ruby setup.rb config
 ruby setup.rb install

I have created two unit tests that are exactly the same apart from their
class and method name class TC_1  def test_tc_1 class TC_2  def
test_tc_2

require 'test/unit'

class TC_1  Test::Unit::TestCase
def test_tc_1
  start_browser('http://gbahevm07l15:9081/wps/portal')
  assert($ie.contains_text('Welcome'))
  $ie.close
end

end


This is an attempt to create a unit test suite

require 'test/unit'
require 'tc_1'
require 'tc_2'

 class TS_MyTests
  suite = Test::Unit::TestSuite.new

   suite  tc_1.suite
   suite  tc_2.suite

   require 'fileutils'
   FileUtils.mkdir_p 'build/report'
   Test::Unit::UI::Reporter.run(suite, 'build/report')  end

 The errors I am receiving are:

 undefined local variable or method `tc_1' for TS_MyTests:Class
(NameError)
 uninitialized constant Test::Unit::UI::Reporter (NameError)

 Can anyone please point me in the right direction?

 Thank You
 Aidy




---
This message and any attachment are confidential and may be privileged
or otherwise protected from disclosure. 
If you are not the intended recipient, please telephone or email the
sender and delete this message and any attachment from your system.  
If you are not the intended recipient you must not copy this message or
attachment or disclose the contents to any other person.

---
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Test::Unit Reports?

2006-06-08 Thread Adrian Rutter

Hi,

Thanks for getting back to me.

This is where I am with comments

#require 'test/unit' #I was under the impression that this would
automatically import the two requires below
require 'test/unit/ui/reporter'
require 'test/unit/ui/console/testrunner'
require 'tc_1'
require 'tc_2'

 class TS_MyTests
  suite = Test::Unit::TestSuite.new

   suite  TC_1.suite
   suite  TC_2.suite

   #Dir.mkdir('build/report') #says file exists
   require 'fileutils'
   FileUtils.mkdir_p 'build/report'

   #I tried this:
   #Reporter.new.run(suite, 'build/report')
   #think it's trying to run the below method from this class

   Test::Unit::UI::Reporter.run(suite, 'build/report')
 end


 The problem I have is with this line:

 Test::Unit::UI::Reporter.run(suite, 'build/report')

 I am told it is an uninitialized constant

 Test::Unit::UI::Reporter::StringIO (NameError)

 Thanks

 Aidy



---
This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. 
If you are not the intended recipient, please telephone or email the sender and 
delete this message and any attachment from your system.  
If you are not the intended recipient you must not copy this message or 
attachment or disclose the contents to any other person.
---
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Test::Unit Reports?

2006-06-07 Thread Charley Baker
Chris and I were just talking about this yesterday: http://rubyforge.org/projects/test-report/Reports in html or xml. -Charley
On 6/7/06, Adrian Rutter [EMAIL PROTECTED] wrote:
Hi,Is there anything about that sits on top of Test::Unit to produce - forexample - html reports, or would it be better to log to XML, then XSLT it?Thank YouAidy---
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure.If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system.
If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.---
___Wtr-general mailing listWtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Test::Unit Reports?

2006-06-07 Thread Lillis, Dara
Indeed there is. Reporter

http://rubyforge.org/projects/test-report/ 

Gives you junit-like output.

I think you need to require 'stringio' for it to work, but aside from
that it's pretty straightforwad.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian Rutter
Sent: Wednesday, June 07, 2006 12:24 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Test::Unit Reports?


Hi,

Is there anything about that sits on top of Test::Unit to produce - for
example - html reports, or would it be better to log to XML, then XSLT
it?

Thank You

Aidy




---
This message and any attachment are confidential and may be privileged
or otherwise protected from disclosure. 
If you are not the intended recipient, please telephone or email the
sender and delete this message and any attachment from your system.  
If you are not the intended recipient you must not copy this message or
attachment or disclose the contents to any other person.

---
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Test::Unit Reports?

2006-06-07 Thread Chris McMahon
 I think you need to require 'stringio' for it to work, but aside from
 that it's pretty straightforwad.

Alex fixed this in 'trunk'.
-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general