From b7f0c77402b197a783acb8e4eb1b7d6e36f43dc8 Mon Sep 17 00:00:00 2001 From: Aliaksandr Trush Date: Thu, 4 Jan 2018 16:16:52 +0300 Subject: [PATCH] some cleanup remove method_missing and rename done method --- lib/report_portal/cucumber/formatter.rb | 4 ++-- lib/report_portal/cucumber/report.rb | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/report_portal/cucumber/formatter.rb b/lib/report_portal/cucumber/formatter.rb index fc2fbed..6d0ab48 100644 --- a/lib/report_portal/cucumber/formatter.rb +++ b/lib/report_portal/cucumber/formatter.rb @@ -44,7 +44,7 @@ def initialize(config) @queue.push([event_name, event, ReportPortal.now]) end end - config.on_event :test_run_finished, &method(:done) + config.on_event :test_run_finished, &method(:on_test_run_finished) end def puts(message) @@ -57,7 +57,7 @@ def embed(*args) @queue.push([:embed, *args, ReportPortal.now]) end - def done(_event) + def on_test_run_finished(_event) @queue.push([:done, ReportPortal.now]) sleep 0.03 while !@queue.empty? || @queue.num_waiting == 0 # TODO: how to interrupt launch if the user aborted execution @thread.kill diff --git a/lib/report_portal/cucumber/report.rb b/lib/report_portal/cucumber/report.rb index 6bbc9d0..0875c4c 100644 --- a/lib/report_portal/cucumber/report.rb +++ b/lib/report_portal/cucumber/report.rb @@ -150,10 +150,6 @@ def embed(src, mime_type, label, desired_time = ReportPortal.now) ReportPortal.send_file(:info, src, label, time_to_send(desired_time),mime_type) end - def method_missing(**args) - puts "Method missing #{args.inspect}" - end - private # Report Portal sorts logs by time. However, several logs might have the same time.