Class: DeltaTest::Generator
- Inherits:
-
Object
- Object
- DeltaTest::Generator
- Defined in:
- lib/delta_test/generator.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#hook_on_exit ⇒ Object
Hook teardown! on exit.
-
#setup! ⇒ Object
Setup table.
-
#start!(spec_file) ⇒ Object
Start profiler for the spec file.
-
#stop! ⇒ Object
Stop profiler and update table.
-
#teardown! ⇒ Object
Save table to the file.
Instance Method Details
#hook_on_exit ⇒ Object
Hook teardown! on exit
85 86 87 |
# File 'lib/delta_test/generator.rb', line 85 def hook_on_exit at_exit { teardown! } end |
#setup! ⇒ Object
Setup table
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/delta_test/generator.rb', line 19 def setup! return unless DeltaTest.active? return if @_setup @_setup = true DeltaTest.log('--- setup!') @table = DependenciesTable.new @current_spec_file = nil end |
#start!(spec_file) ⇒ Object
Start profiler for the spec file
37 38 39 40 41 42 43 44 45 |
# File 'lib/delta_test/generator.rb', line 37 def start!(spec_file) return unless DeltaTest.active? DeltaTest.log('--- start!(%s)' % spec_file) @current_spec_file = Utils.regulate_filepath(spec_file, DeltaTest.config.base_path).to_s Profiler.start! end |
#stop! ⇒ Object
Stop profiler and update table
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/delta_test/generator.rb', line 50 def stop! return unless DeltaTest.active? Profiler.stop! DeltaTest.log('--- stop!') spec_file = @current_spec_file @current_spec_file = nil if spec_file Profiler.last_result.each do |file| @table.add(spec_file, file) end end DeltaTest::Profiler.clean! end |