Class: SimpleJUnit::TestSuiteCollection
- Inherits:
-
Object
- Object
- SimpleJUnit::TestSuiteCollection
- Includes:
- Singleton
- Defined in:
- lib/simple_junit.rb
Instance Attribute Summary collapse
-
#testsuites ⇒ Object
readonly
Returns the value of attribute testsuites.
Instance Method Summary collapse
- #create_testsuite(name) ⇒ Object
-
#initialize ⇒ TestSuiteCollection
constructor
A new instance of TestSuiteCollection.
-
#reset ⇒ Object
This is really the initialize method, but for testing we want to be able to reset the singleton to an initialized state.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ TestSuiteCollection
Returns a new instance of TestSuiteCollection.
12 13 14 15 |
# File 'lib/simple_junit.rb', line 12 def initialize # initialization code needs to be put in reset method for testing self.reset end |
Instance Attribute Details
#testsuites ⇒ Object (readonly)
Returns the value of attribute testsuites.
10 11 12 |
# File 'lib/simple_junit.rb', line 10 def testsuites @testsuites end |
Instance Method Details
#create_testsuite(name) ⇒ Object
17 18 19 20 |
# File 'lib/simple_junit.rb', line 17 def create_testsuite(name) @testsuites << SimpleJUnit::TestSuite.new(name) @testsuites.last end |
#reset ⇒ Object
This is really the initialize method, but for testing we want to be able to reset the singleton to an initialized state
33 34 35 |
# File 'lib/simple_junit.rb', line 33 def reset @testsuites = [] end |
#to_s ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/simple_junit.rb', line 22 def to_s return <<-EOTC <?xml version="1.0" encoding="UTF-8"?> <testsuites> #{(@testsuites.each {|ts| ts.to_s}).join} </testsuites> EOTC end |