Class: Rubinium::TestSuite
- Inherits:
-
Object
- Object
- Rubinium::TestSuite
- Defined in:
- lib/rubinium/test_suite.rb
Instance Attribute Summary collapse
-
#basedir ⇒ Object
Returns the value of attribute basedir.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#name ⇒ Object
Returns the value of attribute name.
-
#tests ⇒ Object
Returns the value of attribute tests.
Instance Method Summary collapse
- #<<(test) ⇒ Object
- #clear ⇒ Object
- #generate ⇒ Object
-
#initialize(name = "Unnamed test suite") {|_self| ... } ⇒ TestSuite
constructor
A new instance of TestSuite.
Constructor Details
#initialize(name = "Unnamed test suite") {|_self| ... } ⇒ TestSuite
Returns a new instance of TestSuite.
4 5 6 7 8 9 |
# File 'lib/rubinium/test_suite.rb', line 4 def initialize(name = "Unnamed test suite") @name = name @basedir = ARGV[0] || "." @tests = [] yield self if block_given? end |
Instance Attribute Details
#basedir ⇒ Object
Returns the value of attribute basedir.
2 3 4 |
# File 'lib/rubinium/test_suite.rb', line 2 def basedir @basedir end |
#filename ⇒ Object
Returns the value of attribute filename.
2 3 4 |
# File 'lib/rubinium/test_suite.rb', line 2 def filename @filename end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/rubinium/test_suite.rb', line 2 def name @name end |
#tests ⇒ Object
Returns the value of attribute tests.
2 3 4 |
# File 'lib/rubinium/test_suite.rb', line 2 def tests @tests end |
Instance Method Details
#<<(test) ⇒ Object
11 12 13 |
# File 'lib/rubinium/test_suite.rb', line 11 def <<(test) @tests << test end |
#clear ⇒ Object
27 28 29 |
# File 'lib/rubinium/test_suite.rb', line 27 def clear @tests.clear end |
#generate ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rubinium/test_suite.rb', line 15 def generate testfiles = [] @tests.each do |test| filename = File.join(@basedir, test.filename) testfiles << [test.name, test.filename] File.open(filename, "w") do |file| test.generate(file) end end generate_suite testfiles end |