Class: Flaky::LogArtifact
- Inherits:
-
Object
- Object
- Flaky::LogArtifact
- Defined in:
- lib/flaky/run.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ LogArtifact
constructor
A new instance of LogArtifact.
- #name(str) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ LogArtifact
Returns a new instance of LogArtifact.
18 19 20 21 22 |
# File 'lib/flaky/run.rb', line 18 def initialize opts={} @result_dir = opts.fetch :result_dir, '' @pass_str = opts.fetch :pass_str, '' @test_name = opts.fetch :test_name, '' end |
Instance Method Details
#name(str) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/flaky/run.rb', line 24 def name str file_name = File.basename(str) str = str[0..-1-file_name.length].gsub('/', '_') str = str + '_' if str[-1] != '_' str += @test_name.split('/').last filename_only = File.basename(@test_name) File.join @result_dir, @pass_str, filename_only, str, file_name end |