knapsack_pro 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/knapsack_pro/adapters/minitest_adapter.rb +14 -3
- data/lib/knapsack_pro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cda0e0e6281dd44b8b51af6d7cac7872f79b08e
|
4
|
+
data.tar.gz: c7911a8fc5345af87a0d29ac224a5143789e0c58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2082cbd396b2c6f4460eff48a7cc0878ca498ccd6285f5a98fa551e04e3e143d90ed1fbee31db9e928a944544f5888d3aff9a893bfd98bcada9c74c1d30198e5
|
7
|
+
data.tar.gz: 7cb3a536848041dfa7c940baeed3cfaf67b8450e6aa9c198e4de06c9a823d14a4837cc2c6a8f3ccf12e02ef46047024d7362a70422619f254fd40a996691394b
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
* TODO
|
4
4
|
|
5
|
+
### 0.1.1
|
6
|
+
|
7
|
+
* Make knapsack_pro backwards compatible with earlier version of minitest
|
8
|
+
|
9
|
+
Related PR from knapsack gem repository:
|
10
|
+
https://github.com/ArturT/knapsack/pull/26
|
11
|
+
|
12
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v0.1.0...v0.1.1
|
13
|
+
|
5
14
|
### 0.1.0
|
6
15
|
|
7
16
|
First working release on rubygems.org.
|
@@ -5,7 +5,8 @@ module KnapsackPro
|
|
5
5
|
@@parent_of_test_dir = nil
|
6
6
|
|
7
7
|
def self.test_path(obj)
|
8
|
-
|
8
|
+
# Pick the first public method in the class itself, that starts with "test_"
|
9
|
+
test_method_name = obj.public_methods(false).select{|m| m =~ /^test_/ }.first
|
9
10
|
method_object = obj.method(test_method_name)
|
10
11
|
full_test_path = method_object.source_location.first
|
11
12
|
parent_of_test_dir_regexp = Regexp.new("^#{@@parent_of_test_dir}")
|
@@ -32,13 +33,13 @@ module KnapsackPro
|
|
32
33
|
def bind_time_tracker
|
33
34
|
::Minitest::Test.send(:include, BindTimeTrackerMinitestPlugin)
|
34
35
|
|
35
|
-
|
36
|
+
add_post_run_callback do
|
36
37
|
KnapsackPro.logger.info(KnapsackPro::Presenter.global_time)
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
40
41
|
def bind_save_report
|
41
|
-
|
42
|
+
add_post_run_callback do
|
42
43
|
KnapsackPro::Report.save
|
43
44
|
end
|
44
45
|
end
|
@@ -47,6 +48,16 @@ module KnapsackPro
|
|
47
48
|
test_dir_path = File.dirname(file_path)
|
48
49
|
@@parent_of_test_dir = File.expand_path('../', test_dir_path)
|
49
50
|
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def add_post_run_callback(&block)
|
55
|
+
if Minitest.respond_to?(:after_run)
|
56
|
+
Minitest.after_run { block.call }
|
57
|
+
else
|
58
|
+
Minitest::Unit.after_tests { block.call }
|
59
|
+
end
|
60
|
+
end
|
50
61
|
end
|
51
62
|
end
|
52
63
|
end
|
data/lib/knapsack_pro/version.rb
CHANGED