Class: TestBench::Executor
- Inherits:
-
Object
- Object
- TestBench::Executor
- Defined in:
- lib/test_bench/executor.rb
Instance Attribute Summary collapse
-
#binding ⇒ Object
readonly
Returns the value of attribute binding.
-
#kernel ⇒ Object
readonly
Returns the value of attribute kernel.
Class Method Summary collapse
Instance Method Summary collapse
- #call(files) ⇒ Object
- #execute(file) ⇒ Object
-
#initialize(binding, kernel) ⇒ Executor
constructor
A new instance of Executor.
- #telemetry ⇒ Object
Constructor Details
#initialize(binding, kernel) ⇒ Executor
Returns a new instance of Executor.
6 7 8 9 |
# File 'lib/test_bench/executor.rb', line 6 def initialize binding, kernel @binding = binding @kernel = kernel end |
Instance Attribute Details
#binding ⇒ Object (readonly)
Returns the value of attribute binding.
3 4 5 |
# File 'lib/test_bench/executor.rb', line 3 def binding @binding end |
#kernel ⇒ Object (readonly)
Returns the value of attribute kernel.
4 5 6 |
# File 'lib/test_bench/executor.rb', line 4 def kernel @kernel end |
Class Method Details
.build ⇒ Object
11 12 13 14 15 |
# File 'lib/test_bench/executor.rb', line 11 def self.build binding = TOPLEVEL_BINDING new binding, Kernel end |
Instance Method Details
#call(files) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/test_bench/executor.rb', line 17 def call files files.each do |file| execute file end telemetry.passed? end |
#execute(file) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/test_bench/executor.rb', line 25 def execute file telemetry.file_started file begin unbound_context_method = TestBench::Structure.instance_method :context bound_context_method = unbound_context_method.bind binding.receiver bound_context_method.call :suppress_exit => true do kernel.load File. file end ensure telemetry.file_finished file end end |