dotpretty 0.1.1 → 0.2.0

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
  SHA256:
3
- metadata.gz: 28558b561bbfa17b59a615647913cee140f5e7845af2c9ddf49919d2706e5dcb
4
- data.tar.gz: 6aca2621c35a00a1d3365ec20da3c6eff2804f1a2b3d42896aa4fe49166c323c
3
+ metadata.gz: 20b38e23e19f36a7f881c9bebba24995b41409373655e50d677d5ab1fdad4aa3
4
+ data.tar.gz: 460ccddd6e4b90d0d83dc1491d2d8cbb7b9c61e83cd7d70b0cafaa96bd9ae3bb
5
5
  SHA512:
6
- metadata.gz: a9375e3513359420fe8d82a4a1fc320dd69c4a02aa404ca9c496b6510dee2a59b2e43b92cd5605bdfb5e64b69b7d4ad0b69fa8e4e9ca85da57794c7bb05b4a5d
7
- data.tar.gz: 99c30c4acf3bf49ce3dcecd51e53bfbaf905d569e242bb82bee5a1c98b3959c05ce2f6231921e1838bded907ab5e8cdd7555ce1a480b59d35ddab2eaea6019f9
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
@@ -4,8 +4,9 @@ module Dotpretty
4
4
 
5
5
  BASIC = "basic"
6
6
  JSON = "json"
7
+ PROGRESS = "progress"
7
8
 
8
- ALL = [BASIC, JSON]
9
+ ALL = [ BASIC, JSON, PROGRESS ]
9
10
  end
10
11
  end
11
12
  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.1.1
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