guard-phpunit2 0.2.1 → 0.2.2
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/lib/guard/phpunit2/formatter.rb +29 -14
- data/lib/guard/phpunit2/version.rb +1 -1
- data/spec/fixtures/results/errors.txt +4 -2
- data/spec/fixtures/results/failing.txt +5 -3
- data/spec/fixtures/results/mixed.txt +21 -16
- data/spec/fixtures/results/passing.txt +4 -2
- data/spec/fixtures/results/skipped_and_incomplete.txt +4 -2
- data/spec/guard/phpunit2/formatter_spec.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: 6d973714f855f21aae92bff20a26d54d47668bde
|
4
|
+
data.tar.gz: 3245c36341cbe47c2b462c0bfe22d63470bf491b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8fb222fc6595da42462255e26ab9ec291b6cd61ac665aaefa2e9d2c0aee0fe9ea25c94f3140c31c97445501ea25b3ec7f8abff806b5c4438d053ff8fcaf4a3e
|
7
|
+
data.tar.gz: f0f1aa7d628f1fed05e6620b30f85a7533bc7658405e2f8f2107ddb13787e6fec1656ae60d924dd670ccd4960c8b0599f54afdc320dd91a5018908a0700c19a8
|
@@ -15,10 +15,10 @@ module Guard
|
|
15
15
|
#
|
16
16
|
def parse_output(text)
|
17
17
|
results = {
|
18
|
-
:tests => look_for_words_in('
|
19
|
-
:failures => look_for_words_in('
|
20
|
-
:errors => look_for_words_in('
|
21
|
-
:pending => look_for_words_in(['
|
18
|
+
:tests => look_for_words_in('[Tests:|tests]', text),
|
19
|
+
:failures => look_for_words_in('Failures:', text),
|
20
|
+
:errors => look_for_words_in('Errors:', text),
|
21
|
+
:pending => look_for_words_in(['Skipped:', 'Incomplete:'], text),
|
22
22
|
:duration => look_for_duration_in(text)
|
23
23
|
}
|
24
24
|
results.freeze
|
@@ -36,16 +36,31 @@ module Guard
|
|
36
36
|
def look_for_words_in(strings_list, text)
|
37
37
|
count = 0
|
38
38
|
strings_list = Array(strings_list)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
39
|
+
|
40
|
+
if text =~ %r{FAILURES} || text =~ %r{OK, but incomplete or skipped tests!}
|
41
|
+
strings_list.each do |s|
|
42
|
+
text =~ %r{
|
43
|
+
#{s}s? # then the string
|
44
|
+
[ ] # then a space
|
45
|
+
(\d+) # count of what we are looking for
|
46
|
+
.* # then whatever
|
47
|
+
\Z # start looking at the end of the text
|
48
|
+
}x
|
49
|
+
count += $1.to_i unless $1.nil?
|
50
|
+
end
|
51
|
+
else
|
52
|
+
strings_list.each do |s|
|
53
|
+
text =~ %r{
|
54
|
+
(\d+) # count of what we are looking for
|
55
|
+
[ ] # then a space
|
56
|
+
#{s}s? # then the string
|
57
|
+
.* # then whatever
|
58
|
+
\Z # start looking at the end of the text
|
59
|
+
}x
|
60
|
+
count += $1.to_i unless $1.nil?
|
61
|
+
end
|
48
62
|
end
|
63
|
+
|
49
64
|
count
|
50
65
|
end
|
51
66
|
|
@@ -55,7 +70,7 @@ module Guard
|
|
55
70
|
# @return [Integer] the duration
|
56
71
|
#
|
57
72
|
def look_for_duration_in(text)
|
58
|
-
text =~ %r{
|
73
|
+
text =~ %r{Time: (\d)+ seconds?.*\Z}m
|
59
74
|
$1.nil? ? 0 : $1.to_i
|
60
75
|
end
|
61
76
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
E
|
2
2
|
|
3
|
+
Time: 3 seconds, Memory: 5.75Mb
|
4
|
+
|
3
5
|
Errors:
|
4
6
|
|
5
7
|
1) NumberTest::testMathStillWorks
|
@@ -7,5 +9,5 @@ Errors:
|
|
7
9
|
# /home/maher/Projects/php/PHPUnit-Progress/Tests/_files/Number.php:61
|
8
10
|
# /home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:81
|
9
11
|
|
10
|
-
|
11
|
-
1
|
12
|
+
FAILURES!
|
13
|
+
Tests: 1, Assertions: 0, Failures: 1.
|
@@ -1,6 +1,8 @@
|
|
1
1
|
FF
|
2
2
|
|
3
|
-
|
3
|
+
Time: 0 seconds, Memory: 5.75Mb
|
4
|
+
|
5
|
+
There was 2 failure:
|
4
6
|
|
5
7
|
1) NumberTest::testThatMyMathTeacherSucked
|
6
8
|
Failed asserting that 10 is identical to 1.
|
@@ -11,5 +13,5 @@ Failures:
|
|
11
13
|
Failed asserting that 'I don't know!' is identical to -1.
|
12
14
|
# /home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:72
|
13
15
|
|
14
|
-
|
15
|
-
2
|
16
|
+
FAILURES!
|
17
|
+
Tests: 2, Assertions: 2, Failures: 2.
|
@@ -1,26 +1,31 @@
|
|
1
1
|
......SSFFEIF
|
2
2
|
|
3
|
-
|
3
|
+
Time: 2 seconds, Memory: 5.75Mb
|
4
4
|
|
5
|
-
|
6
|
-
NumberException: Division by zero!
|
7
|
-
# /home/maher/Projects/php/PHPUnit-Progress/Tests/_files/Number.php:61
|
8
|
-
# /home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:81
|
5
|
+
There was 1 error:
|
9
6
|
|
10
|
-
Failures:
|
11
7
|
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
1) NumberTest::testMathStillWorks
|
9
|
+
NumberException: Division by zero!
|
10
|
+
|
11
|
+
/home/maher/Projects/php/PHPUnit-Progress/Tests/_files/Number.php:61
|
12
|
+
/home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:81
|
15
13
|
|
14
|
+
--
|
16
15
|
|
17
|
-
2) NumberTest::testThatMyMathTeacherSuckedEvenMore
|
18
|
-
Failed asserting that 'I don't know!' is identical to -1.
|
19
|
-
# /home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:72
|
20
16
|
|
17
|
+
There was 1 failure:
|
21
18
|
|
22
|
-
|
23
|
-
|
19
|
+
1) NumberTest::testThatMyMathTeacherSucked
|
20
|
+
Failed asserting that 10 is identical to 1.
|
24
21
|
|
25
|
-
|
26
|
-
|
22
|
+
/home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:62
|
23
|
+
|
24
|
+
|
25
|
+
2) NumberTest::testThatMyMathTeacherSuckedEvenMore
|
26
|
+
Failed asserting that 'I don't know!' is identical to -1.
|
27
|
+
|
28
|
+
/home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:72
|
29
|
+
|
30
|
+
FAILURES!
|
31
|
+
Tests: 13, Assertions: 4, Failures: 3, Errors: 1, Incomplete: 1, Skipped: 2.
|