29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/suspect/rspec_listener.rb', line 29
def register_listener(reporter)
root_path = ::Pathname.new('.')
file_helper = ::Suspect::FileUtils::Idempotent.new
structure = ::Suspect::Setup::Structure.new(root_path)
collector_id_generator = ::Suspect::Setup::CollectorIdGenerator.new
::Suspect::Setup::Creator.new(structure, collector_id_generator, file_helper).build
storage_path = ::Suspect::Storage::DirPath.new(structure.storage_path, Time.now.utc)
collector_id = file_helper.read(structure.collector_id_path)
storage = ::Suspect::Storage::Appender.new(dir_path: storage_path, dir_helper: file_helper, collector_id: collector_id)
file_tree = ::Suspect::FileTree::Git::Snapshot.new
listener = ::Suspect::Gathering::RSpec::Listener.new(file_tree, storage, collector_id, ::Time.now.utc)
reporter.register_listener listener, *listener.notification_names
end
|