Class: Bulldogger::Instance
- Inherits:
-
Object
- Object
- Bulldogger::Instance
- Defined in:
- lib/bulldogger/instance.rb
Overview
Owns one independent capture, run, and evidence lifecycle. One module singleton cannot serve as the reset subject and the outer observer. A separate instance lets a test suite reset the subject while the observer stays active. This class does not define file schemas or serialization.
Each instance keeps its own :raise subscription. Two subscriptions fired independently in measurements, and disabling one left the other active. Each subscription cost about 0.03 microseconds per raise. A shared dispatcher would add a registry and lifecycle coordination without a measured need.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #begin_test ⇒ Object
- #configure {|config| ... } ⇒ Object
- #end_test ⇒ Object
- #finish ⇒ Object
-
#initialize(config: Config.new) ⇒ Instance
constructor
A new instance of Instance.
- #probe(*target_strings, &block) ⇒ Object
- #probe_compare(path_a, path_b) ⇒ Object
- #probe_start(*target_strings) ⇒ Object
- #record_failure(exception:, test:) ⇒ Object
- #run_dir ⇒ Object
- #running? ⇒ Boolean
- #snapshot_for(exception) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
15 16 17 |
# File 'lib/bulldogger/instance.rb', line 15 def config @config end |
Instance Method Details
#begin_test ⇒ Object
47 48 49 |
# File 'lib/bulldogger/instance.rb', line 47 def begin_test capture.begin_test end |
#configure {|config| ... } ⇒ Object
21 22 23 24 |
# File 'lib/bulldogger/instance.rb', line 21 def configure yield config self end |
#end_test ⇒ Object
51 52 53 |
# File 'lib/bulldogger/instance.rb', line 51 def end_test capture.end_test end |
#finish ⇒ Object
63 64 65 |
# File 'lib/bulldogger/instance.rb', line 63 def finish run.finish end |
#probe(*target_strings, &block) ⇒ Object
67 68 69 |
# File 'lib/bulldogger/instance.rb', line 67 def probe(*target_strings, &block) Probe.call(target_strings, config: config, run: run, &block) end |
#probe_compare(path_a, path_b) ⇒ Object
75 76 77 |
# File 'lib/bulldogger/instance.rb', line 75 def probe_compare(path_a, path_b) Probe.compare(path_a, path_b) end |
#probe_start(*target_strings) ⇒ Object
71 72 73 |
# File 'lib/bulldogger/instance.rb', line 71 def probe_start(*target_strings) Probe.start(target_strings, config: config, run: run) end |
#record_failure(exception:, test:) ⇒ Object
55 56 57 |
# File 'lib/bulldogger/instance.rb', line 55 def record_failure(exception:, test:) evidence.record_failure(exception: exception, test: test) end |
#run_dir ⇒ Object
59 60 61 |
# File 'lib/bulldogger/instance.rb', line 59 def run_dir run.dir end |
#running? ⇒ Boolean
39 40 41 |
# File 'lib/bulldogger/instance.rb', line 39 def running? capture.running? end |
#snapshot_for(exception) ⇒ Object
43 44 45 |
# File 'lib/bulldogger/instance.rb', line 43 def snapshot_for(exception) capture.snapshot_for(exception) end |
#start ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/bulldogger/instance.rb', line 26 def start return self unless config.enabled code_state capture.start self end |
#stop ⇒ Object
34 35 36 37 |
# File 'lib/bulldogger/instance.rb', line 34 def stop capture.stop self end |