Class: ParallelTests::RSpec::LoggerBase
- Inherits:
-
RSpec::Core::Formatters::BaseTextFormatter
- Object
- RSpec::Core::Formatters::BaseTextFormatter
- ParallelTests::RSpec::LoggerBase
- Defined in:
- lib/parallel_tests/rspec/logger_base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#close ⇒ Object
stolen from Rspec.
-
#initialize(*args) ⇒ LoggerBase
constructor
A new instance of LoggerBase.
Constructor Details
#initialize(*args) ⇒ LoggerBase
Returns a new instance of LoggerBase.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/parallel_tests/rspec/logger_base.rb', line 10 def initialize(*args) super @output ||= args[0] case @output when String # a path ? FileUtils.mkdir_p(File.dirname(@output)) File.open(@output, 'w') {} # overwrite previous results @output = File.open(@output, 'a') when File # close and restart in append mode @output.close @output = File.open(@output.path, 'a') end end |
Instance Method Details
#close ⇒ Object
stolen from Rspec
27 28 29 |
# File 'lib/parallel_tests/rspec/logger_base.rb', line 27 def close(*) @output.close if (IO === @output) & (@output != $stdout) end |