Sha256: c01f4c3538ece80e3c0918bc98dadca40f6d3da67cc9d8d7ae88af9d1c485aab
Contents?: true
Size: 1.18 KB
Versions: 4
Compression:
Stored size: 1.18 KB
Contents
module Knapsack module Adapters class RspecAdapter < BaseAdapter def bind_time_tracker ::RSpec.configure do |config| config.before(:each) do Knapsack.tracker.spec_path = RspecAdapter.spec_path Knapsack.tracker.start_timer end config.after(:each) do Knapsack.tracker.stop_timer end config.after(:suite) do puts Presenter.global_time end end end def bind_report_generator ::RSpec.configure do |config| config.after(:suite) do Knapsack.report.save puts Presenter.report_details end end end def bind_time_offset_warning ::RSpec.configure do |config| config.after(:suite) do puts Presenter.time_offset_warning end end end protected def self.spec_path example_group = ::RSpec.current_example.metadata[:example_group] while !example_group[:parent_example_group].nil? example_group = example_group[:parent_example_group] end example_group[:file_path] end end end end
Version data entries
4 entries across 4 versions & 1 rubygems