Sha256: 5264472d7c9839c67b1a14bfa1457f38be38b6cfaff93d829e6bd29fe8e25ce6
Contents?: true
Size: 1.56 KB
Versions: 58
Compression:
Stored size: 1.56 KB
Contents
RSpec::Support.require_rspec_core('formatters/profile_formatter') module KnapsackPro module Formatters module RSpecQueueProfileFormatterExtension def self.print_summary return unless KnapsackPro::Config::Env.modify_default_rspec_formatters? ::RSpec::Core::Formatters::ProfileFormatter.print_profile_summary end def initialize(output) @output = output self.class.registered_output = output end def dump_profile(profile) self.class.most_recent_profile = profile end end end end if KnapsackPro::Config::Env.modify_default_rspec_formatters? class RSpec::Core::Formatters::ProfileFormatter prepend KnapsackPro::Formatters::RSpecQueueProfileFormatterExtension def self.registered_output=(output) @registered_output = { ENV['KNAPSACK_PRO_QUEUE_ID'] => output } end def self.registered_output @registered_output ||= {} @registered_output[ENV['KNAPSACK_PRO_QUEUE_ID']] end def self.most_recent_profile=(profile) @most_recent_profile = { ENV['KNAPSACK_PRO_QUEUE_ID'] => profile } end def self.most_recent_profile @most_recent_profile ||= {} @most_recent_profile[ENV['KNAPSACK_PRO_QUEUE_ID']] || [] end def self.print_profile_summary return unless registered_output profile_formatter = new(registered_output) profile_formatter.send(:dump_profile_slowest_examples, most_recent_profile) profile_formatter.send(:dump_profile_slowest_example_groups, most_recent_profile) end end end
Version data entries
58 entries across 58 versions & 1 rubygems