Class: Rubidium::Converter
- Inherits:
-
Object
- Object
- Rubidium::Converter
- Defined in:
- lib/rubidium/converter.rb
Instance Attribute Summary collapse
-
#test_suites ⇒ Object
readonly
Returns the value of attribute test_suites.
Instance Method Summary collapse
-
#initialize(source_folder) ⇒ Converter
constructor
given a source directory, find all test suites in it, and prepare ruby translations of them.
-
#write!(output_folder) ⇒ Object
write the ruby tests to the given output folder.
Constructor Details
#initialize(source_folder) ⇒ Converter
given a source directory, find all test suites in it, and prepare ruby translations of them.
9 10 11 12 13 14 15 |
# File 'lib/rubidium/converter.rb', line 9 def initialize(source_folder) raise ArgumentError.new("source folder expected") unless File.directory?(source_folder) @test_suites = `grep -rnl suiteTable #{source_folder}`.split("\n").map do |fn| TestSuite.new(fn) end end |
Instance Attribute Details
#test_suites ⇒ Object (readonly)
Returns the value of attribute test_suites.
6 7 8 |
# File 'lib/rubidium/converter.rb', line 6 def test_suites @test_suites end |
Instance Method Details
#write!(output_folder) ⇒ Object
write the ruby tests to the given output folder
18 19 20 21 |
# File 'lib/rubidium/converter.rb', line 18 def write!(output_folder) FileUtils.mkdir_p output_folder unless File.directory?(output_folder) SpecWriter.new(output_folder).write!(@test_suites) end |