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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25e1c7f4051f51755b045436eacfd314d3d3c561
4
- data.tar.gz: ff726d26e443aed564382611d7b730be0e62d15e
3
+ metadata.gz: 6d973714f855f21aae92bff20a26d54d47668bde
4
+ data.tar.gz: 3245c36341cbe47c2b462c0bfe22d63470bf491b
5
5
  SHA512:
6
- metadata.gz: 40c41dff5824407ca8bd0dc31c2566da9a2fa23ed4933a2c51f885026d1a846c37affafa9460c37200c3235fc66791bf6334db8fe730d8c93f04b7ab919f9f79
7
- data.tar.gz: 4eccfb676173ae0b94d5a16af0fc264df88f080969578c79e52d434ee8b383e70d785a6fe2680ec7f8db9c391f741b495b2e4bf0e281d48daee2b5d99622af5f
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('test', text),
19
- :failures => look_for_words_in('failure', text),
20
- :errors => look_for_words_in('error', text),
21
- :pending => look_for_words_in(['skipped', 'incomplete'], text),
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
- strings_list.each do |s|
40
- text =~ %r{
41
- (\d+) # count of what we are looking for
42
- [ ] # then a space
43
- #{s}s? # then the string
44
- .* # then whatever
45
- \Z # start looking at the end of the text
46
- }x
47
- count += $1.to_i unless $1.nil?
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{Finished in (\d)+ seconds?.*\Z}m
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,5 @@
1
1
  module Guard
2
2
  module PHPUnit2
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  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
- Finished in 0 seconds
11
- 1 test, 0 assertions, 1 errors
12
+ FAILURES!
13
+ Tests: 1, Assertions: 0, Failures: 1.
@@ -1,6 +1,8 @@
1
1
  FF
2
2
 
3
- Failures:
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
- Finished in 0 seconds
15
- 2 tests, 2 assertions, 2 failures
16
+ FAILURES!
17
+ Tests: 2, Assertions: 2, Failures: 2.
@@ -1,26 +1,31 @@
1
1
  ......SSFFEIF
2
2
 
3
- Errors:
3
+ Time: 2 seconds, Memory: 5.75Mb
4
4
 
5
- 1) NumberTest::testMathStillWorks
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
- 1) NumberTest::testThatMyMathTeacherSucked
13
- Failed asserting that 10 is identical to 1.
14
- # /home/maher/Projects/php/PHPUnit-Progress/Tests/_files/NumberTest.php:62
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
- 3) Warning
23
- No tests found in class "emptyTest".
19
+ 1) NumberTest::testThatMyMathTeacherSucked
20
+ Failed asserting that 10 is identical to 1.
24
21
 
25
- Finished in 2 seconds
26
- 13 tests, 4 assertions, 3 failures, 1 errors, 1 incomplete, 2 skipped
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.
@@ -1,4 +1,6 @@
1
1
  ..
2
2
 
3
- Finished in 0 seconds
4
- 2 tests, 2 assertions
3
+ Time: 0 seconds, Memory: 5.75Mb
4
+
5
+ OK (2 tests, 2 assertions)
6
+
@@ -1,4 +1,6 @@
1
1
  ISS
2
2
 
3
- Finished in 0 seconds
4
- 3 tests, 0 assertions, 1 incomplete, 2 skipped
3
+ Time: 0 seconds, Memory: 5.75Mb
4
+
5
+ OK, but incomplete or skipped tests!
6
+ Tests: 3, Assertions: 0, Incomplete: 1, Skipped: 2.
@@ -12,7 +12,7 @@ describe Guard::PHPUnit2::Formatter do
12
12
  }
13
13
  end
14
14
  end
15
-
15
+
16
16
  context 'when all tests fail' do
17
17
  it 'returns a hash containing the tests result' do
18
18
  output = load_phpunit_output('failing')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-phpunit2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maher Sallam