dotpretty 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dotpretty/reporters/factory.rb +3 -0
- data/lib/dotpretty/reporters/names.rb +2 -1
- data/lib/dotpretty/reporters/progress.rb +59 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b38e23e19f36a7f881c9bebba24995b41409373655e50d677d5ab1fdad4aa3
|
4
|
+
data.tar.gz: 460ccddd6e4b90d0d83dc1491d2d8cbb7b9c61e83cd7d70b0cafaa96bd9ae3bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d47f987444eeb3c10a9e7d96507e1c8f67c1a7ae6ecdd098ed9c4b351c670218ed575a604d2e635d48db4c0d460d53bbe2227d32b62800edbd08e6c13a919537
|
7
|
+
data.tar.gz: 01a556c929fcc4efd6eb19e3d0a622f4dde5d939438fe3b8421423136111abc9854d52133dc2f053956fd4c6b48fe931b0c533d43d8ae4fb993763ac203bcc6c
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "dotpretty/reporters/basic"
|
2
2
|
require "dotpretty/reporters/json"
|
3
3
|
require "dotpretty/reporters/names"
|
4
|
+
require "dotpretty/reporters/progress"
|
4
5
|
|
5
6
|
module Dotpretty
|
6
7
|
module Reporters
|
@@ -10,6 +11,8 @@ module Dotpretty
|
|
10
11
|
case name
|
11
12
|
when Dotpretty::Reporters::Names::JSON
|
12
13
|
return Dotpretty::Reporters::Json.new(output)
|
14
|
+
when Dotpretty::Reporters::Names::PROGRESS
|
15
|
+
return Dotpretty::Reporters::Progress.new(output)
|
13
16
|
else
|
14
17
|
return Dotpretty::Reporters::Basic.new(output)
|
15
18
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Dotpretty
|
2
|
+
module Reporters
|
3
|
+
class Progress
|
4
|
+
|
5
|
+
def initialize(output)
|
6
|
+
self.failing_tests = []
|
7
|
+
self.output = output
|
8
|
+
end
|
9
|
+
|
10
|
+
def build_completed
|
11
|
+
output.puts("Build completed")
|
12
|
+
output.puts("")
|
13
|
+
end
|
14
|
+
|
15
|
+
def build_started
|
16
|
+
output.puts("Build started")
|
17
|
+
end
|
18
|
+
|
19
|
+
def show_test_summary(summary)
|
20
|
+
output.puts("")
|
21
|
+
output.puts("")
|
22
|
+
show_failure_summary if !failing_tests.empty?
|
23
|
+
output.puts("Total tests: #{summary[:totalTests]}. Passed: #{summary[:passedTests]}. Failed: #{summary[:failedTests]}. Skipped: #{summary[:skippedTests]}.\n")
|
24
|
+
end
|
25
|
+
|
26
|
+
def starting_tests
|
27
|
+
output.puts("Starting test execution")
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_failed(failing_test)
|
31
|
+
failing_tests << failing_test
|
32
|
+
output.print("F")
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_passed(passing_test)
|
36
|
+
output.print(".")
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def show_failure_summary
|
42
|
+
output.puts("Failures:")
|
43
|
+
output.puts("")
|
44
|
+
failing_tests.each_with_index do |failing_test, index|
|
45
|
+
output.puts(" #{index + 1}) #{failing_test[:name]}")
|
46
|
+
output.puts("")
|
47
|
+
failing_test[:details].each do |detail|
|
48
|
+
output.puts(" #{detail}")
|
49
|
+
end
|
50
|
+
output.puts("")
|
51
|
+
end
|
52
|
+
output.puts("")
|
53
|
+
end
|
54
|
+
|
55
|
+
attr_accessor :failing_tests, :output
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotpretty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Meyer
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- lib/dotpretty/reporters/factory.rb
|
26
26
|
- lib/dotpretty/reporters/json.rb
|
27
27
|
- lib/dotpretty/reporters/names.rb
|
28
|
+
- lib/dotpretty/reporters/progress.rb
|
28
29
|
- lib/dotpretty/state_details.rb
|
29
30
|
- lib/dotpretty/state_machine.rb
|
30
31
|
- lib/dotpretty/state_machine_builder.rb
|