Class: KnapsackPro::Adapters::MinitestAdapter
Defined Under Namespace
Modules: BindQueueModeMinitestPlugin, BindTimeTrackerMinitestPlugin
Constant Summary
collapse
- TEST_DIR_PATTERN =
'test/**{,/*/**}/*_test.rb'
- @@parent_of_test_dir =
nil
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseAdapter
adapter_bind_method_called_file, bind, #bind, #bind_after_queue_hook, #bind_before_queue_hook, calculate_slow_id_paths, split_by_test_cases_enabled?, verify_bind_method_called
Class Method Details
.test_path(obj) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/knapsack_pro/adapters/minitest_adapter.rb', line 9
def self.test_path(obj)
path, _line =
begin
Object.const_source_location(obj.class.to_s)
rescue NameError nil
end
if path.nil? test_method_name = obj.class.runnable_methods.first
path, _line = obj.method(test_method_name).source_location
end
path.gsub(Regexp.new("^#{@@parent_of_test_dir}"), '.')
end
|
Instance Method Details
#bind_queue_mode ⇒ Object
#bind_save_report ⇒ Object
46
47
48
49
50
|
# File 'lib/knapsack_pro/adapters/minitest_adapter.rb', line 46
def bind_save_report
add_post_run_callback do
KnapsackPro::Report.save
end
end
|
#bind_time_tracker ⇒ Object
#set_test_helper_path(file_path) ⇒ Object
52
53
54
55
|
# File 'lib/knapsack_pro/adapters/minitest_adapter.rb', line 52
def set_test_helper_path(file_path)
test_dir_path = File.dirname(file_path)
@@parent_of_test_dir = File.expand_path('../', test_dir_path)
end
|