doggo 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +10 -10
  2. data/README.md +43 -0
  3. data/lib/doggo.rb +8 -4
  4. data/spec/internal_spec.rb +13 -1
  5. metadata +4 -4
checksums.yaml CHANGED
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  !binary "U0hBMjU2":
3
3
  metadata.gz: !binary |-
4
- MTYyNGM4ZGRjMWVjNWEyNmNhYzA1YjUwZjgzZDg1Y2Y4OWQ1ZjgwYmIwYzJi
5
- ZDhkMjlhMWUxM2U2NTEwNzBlNw==
4
+ ODUxZDM4MDFmM2Y2ZWVhZmYyMDRjNTk2NDc2MmVkZDg5YjgzZjFhMThiOGE1
5
+ YmNmNTYwZWQ1MTgwOTczYjZjNQ==
6
6
  data.tar.gz: !binary |-
7
- MTYxOWUzNDE1MmIwMWMwNWY3MTI0ZjA0MTE5ZjMxN2U5MGM3YjVjMjg4OGQ0
8
- N2IwZjcwMjAzODI4YzVmZTgzZg==
7
+ ZTQ1MmMzN2FmY2VhY2E0OGE0YzNlNDY4OTg4OTZkNWQ4ZTU0ZDY4NWVkNzEx
8
+ YjE5YWVhZTY5MjRkYTk2MmZkNw==
9
9
  SHA512:
10
10
  metadata.gz: !binary |-
11
- ZWYyZjkyOThhMzYxYTc5Y2YyOGIyM2MxZjExZmJjNzkzMTYwOTllNzZkNGQ2
12
- ODFmMzZjZmM3NzBiOGU0ZGY2YjlmMmY4MTRkMDdiNjZkMWFlMDE3ODRlM2I1
13
- N2RhZTQ4MzBjZmU0OTJjNDJjOGZkOWI5YzBiNmU5YWFhOTVjYjk=
11
+ MTc5Mjc2ODljYmE1ZDg4ZjVjNDM4Zjg1N2FkMmI2MjhjNDMzOWExYWIyMzAy
12
+ YTJiNDQ3MGZhMWNmOWUwODc4NzMzMDgzOTNmMGM3MjdjMTEzMGZiN2VlZDQy
13
+ ZGNiMWEzZmVhNTg2YmQxNzQyN2RmZDFmOGMwYTk4NmFmYTU2MzY=
14
14
  data.tar.gz: !binary |-
15
- YjA4ZmE4M2RkZDhlNWVlMWNmZjljNjBhZGMyMmVjYTAwMjIwMGUwMGM0OTQ2
16
- ODZkYzFlZDdjNTQ5MjM5NTEyYWUyNjY1NWM2MThiYjBhN2I2YjYzZGRjNjE3
17
- NDYwYmYyNzA0YWZjYWEzMDA1ZWRhZjYyYzk1NGNhZGNjYWU2YTQ=
15
+ MTg4NmRmYTg0MGNkNTM3N2ZhNmYxMjYwY2JlNmRlYjg0YzZiNWRiN2FhM2Jm
16
+ NTUyMjIxODUwY2FiM2YyOTczYzRjNTEyZGM2ZjIxYzQxODE1MmQ4ZWYzZmE4
17
+ YTg0NzI4YTgzZTYzZDIwYjgxNGI3NzY3YjJlMzNlNGU1OTgwM2E=
data/README.md CHANGED
@@ -12,14 +12,56 @@ Regenerate this with `FOR_EXAMPLE=yes bundle exec rspec --order defined`:
12
12
  [ 10] Doggo examples
13
13
  [01/10] outer passes
14
14
  [02/10] FAILED (1) - outer fails
15
+
16
+ 1) Doggo examples outer fails
17
+ Failure/Error: expect(true).to eql(false)
18
+
19
+ expected: false
20
+ got: true
21
+
22
+ (compared using eql?)
23
+
24
+ Diff:
25
+ @@ -1,2 +1,2 @@
26
+ -false
27
+ +true
28
+
29
+ # ./spec/example/doggo_spec.rb:29:in `block (2 levels) in <top (required)>'
30
+
15
31
  [03/10] PENDING - outer is pending with xit
16
32
  [04/10] FAILED (2) - outer is pending with a custom message
33
+
34
+ 2) Doggo examples outer is pending with a custom message FIXED
35
+ Expected pending 'custom message' to fail. No error was raised.
36
+ # ./spec/example/doggo_spec.rb:35
37
+
17
38
  [ 10] in a context
18
39
  [ 10] with a nested context
19
40
  [05/10] passes
20
41
  [06/10] FAILED (3) - fails
42
+
43
+ 3) Doggo examples in a context with a nested context fails
44
+ Failure/Error: expect(true).to eql(false)
45
+
46
+ expected: false
47
+ got: true
48
+
49
+ (compared using eql?)
50
+
51
+ Diff:
52
+ @@ -1,2 +1,2 @@
53
+ -false
54
+ +true
55
+
56
+ # ./spec/example/doggo_spec.rb:12:in `block (4 levels) in <top (required)>'
57
+
21
58
  [07/10] PENDING - is pending with xit
22
59
  [08/10] FAILED (4) - is pending with a custom message
60
+
61
+ 4) Doggo examples in a context with a nested context is pending with a custom message FIXED
62
+ Expected pending 'custom message' to fail. No error was raised.
63
+ # ./spec/example/doggo_spec.rb:18
64
+
23
65
  [ 10] test count
24
66
  [09/10] is taken to 9
25
67
  [10/10] is taken to 10, showing leading zero pad formatting
@@ -31,6 +73,7 @@ Notable things are:
31
73
  * Left zero padding to keep column alignment, working for any number of total tests
32
74
  * `FAILED` and `PENDING` states are shown on the left side of the message, not the right as with RSpec's `--format documentation`, to make them a little easier to see in CI output
33
75
  * A `PENDING` default message of `Temporarily skipped with xit` is suppressed for brevity, but any other message would be shown inline.
76
+ * Detailed failure messages are shown inline, so you can start investigating test failures while your test suite continues to run.
34
77
 
35
78
  ## Installation
36
79
 
@@ -71,7 +71,7 @@ class Doggo < RSpec::Core::Formatters::BaseTextFormatter
71
71
 
72
72
  def example_passed(passed)
73
73
  self.outstr.puts(passed_output(passed.example))
74
- flush_messages
74
+ flush_messages()
75
75
 
76
76
  self.passed_count += 1
77
77
  self.example_running = false
@@ -85,17 +85,21 @@ class Doggo < RSpec::Core::Formatters::BaseTextFormatter
85
85
  )
86
86
  )
87
87
 
88
- flush_messages
88
+ flush_messages()
89
89
 
90
90
  self.pending_count += 1
91
91
  self.example_running = false
92
92
  end
93
93
 
94
94
  def example_failed(failure)
95
+ self.failed_count += 1
96
+
95
97
  self.outstr.puts(failure_output(failure.example))
96
- flush_messages
98
+ self.outstr.puts(failure.fully_formatted(self.failed_count))
99
+ self.outstr.puts("\n")
100
+
101
+ flush_messages()
97
102
 
98
- self.failed_count += 1
99
103
  self.example_running = false
100
104
  end
101
105
 
@@ -91,7 +91,12 @@ RSpec.describe Doggo do
91
91
  context '#example_failed' do
92
92
  before :each do
93
93
  @dog.start(@notification)
94
+ @detail = 'failure detail'
94
95
  @failed = double('Failing test', example: @example)
96
+
97
+ allow(@failed).to receive(:fully_formatted) do | count |
98
+ "#{count} #{@detail}"
99
+ end
95
100
  end
96
101
 
97
102
  it 'notes an example is no longer running' do
@@ -116,7 +121,7 @@ RSpec.describe Doggo do
116
121
  expect(@dog.failed_count).to eql(2)
117
122
  end
118
123
 
119
- it 'logs the failure' do
124
+ it 'logs the summary failure' do
120
125
  @dog.example_started(@notification)
121
126
  @dog.example_failed(@failed)
122
127
 
@@ -124,6 +129,13 @@ RSpec.describe Doggo do
124
129
  expect(@bork.string).to include('FAILED')
125
130
  expect(@bork.string).to include(@example_description)
126
131
  end
132
+
133
+ it 'logs the detailed failure' do
134
+ @dog.example_started(@notification)
135
+ @dog.example_failed(@failed)
136
+
137
+ expect(@bork.string).to include("1 #{@detail}")
138
+ end
127
139
  end # "context '#example_failed' do"
128
140
 
129
141
  context '#example_pending' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doggo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RIP Global
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-06 00:00:00.000000000 Z
12
+ date: 2020-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-core
@@ -61,7 +61,7 @@ licenses:
61
61
  metadata:
62
62
  homepage_uri: https://www.ripglobal.com/
63
63
  source_code_uri: https://github.com/ripglobal/doggo/
64
- bug_tracker_uri: https://github.com/ripglobal/doggo/
64
+ bug_tracker_uri: https://github.com/ripglobal/doggo/issues/
65
65
  changelog_uri: https://github.com/ripglobal/doggo/blob/master/CHANGELOG.md
66
66
  post_install_message:
67
67
  rdoc_options: []
@@ -82,7 +82,7 @@ rubyforge_project:
82
82
  rubygems_version: 2.7.10
83
83
  signing_key:
84
84
  specification_version: 4
85
- summary: RSpec formatter - documentation, with progress indication
85
+ summary: RSpec 3 formatter - documentation, with progress indication
86
86
  test_files:
87
87
  - spec/spec_helper.rb
88
88
  - spec/internal_spec.rb