fivemat 1.3.0 → 1.3.1
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/fivemat.gemspec +1 -1
- data/lib/fivemat.rb +3 -3
- data/lib/fivemat/rspec3.rb +24 -32
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a5b609f9df1bdb02278cb9d1c00ae1795ed939f
|
4
|
+
data.tar.gz: ae9f16c478877ad98754b952d5749e60d807da89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388ae947ef201509b647deb0204f16ec428c433ee74ef3bfb8d946795ad2f9311e0ea8cb15ffb1ea5c585115357627d090aafa762652bfd6e944455f66d65752
|
7
|
+
data.tar.gz: 5cb2396594c40a0f676648a17f0846ff9a7b83654fc7822e325fba0240c1054c3eb7f4bc49e1732aeea5205f8d98e862b75d3098fd55852c379df7230d8ea133
|
data/fivemat.gemspec
CHANGED
data/lib/fivemat.rb
CHANGED
@@ -8,7 +8,7 @@ module Fivemat
|
|
8
8
|
autoload :Spec, 'fivemat/spec'
|
9
9
|
|
10
10
|
def rspec3?
|
11
|
-
defined?(::RSpec) && ::RSpec::Core::Version::STRING >= '3.0.0'
|
11
|
+
defined?(::RSpec::Core) && ::RSpec::Core::Version::STRING >= '3.0.0'
|
12
12
|
end
|
13
13
|
module_function :rspec3?
|
14
14
|
|
@@ -21,8 +21,8 @@ module Fivemat
|
|
21
21
|
:example_failed,
|
22
22
|
:example_group_started,
|
23
23
|
:example_group_finished,
|
24
|
-
:
|
25
|
-
:
|
24
|
+
:dump_summary,
|
25
|
+
:seed
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.new(*args)
|
data/lib/fivemat/rspec3.rb
CHANGED
@@ -1,74 +1,66 @@
|
|
1
|
-
require 'rspec/core/formatters/
|
1
|
+
require 'rspec/core/formatters/console_codes'
|
2
2
|
|
3
3
|
module Fivemat
|
4
|
-
class RSpec3
|
4
|
+
class RSpec3
|
5
5
|
include ElapsedTime
|
6
6
|
|
7
7
|
# See fivemat.rb for formatter registration.
|
8
|
+
attr_reader :output, :failed_notifications
|
8
9
|
|
9
10
|
def initialize(output)
|
10
|
-
|
11
|
+
@output = output
|
11
12
|
@group_level = 0
|
12
13
|
@index_offset = 0
|
13
|
-
@
|
14
|
-
@failed_examples = []
|
14
|
+
@failed_notifications = []
|
15
15
|
end
|
16
16
|
|
17
|
+
Color = ::RSpec::Core::Formatters::ConsoleCodes
|
18
|
+
|
17
19
|
def example_passed(notification)
|
18
|
-
output.print
|
20
|
+
output.print Color.wrap('.', :success)
|
19
21
|
end
|
20
22
|
|
21
23
|
def example_pending(notification)
|
22
|
-
|
23
|
-
output.print pending_color('*')
|
24
|
+
output.print Color.wrap('*', :pending)
|
24
25
|
end
|
25
26
|
|
26
|
-
def example_failed(
|
27
|
-
|
28
|
-
output.print
|
27
|
+
def example_failed(notification)
|
28
|
+
@failed_notifications << notification
|
29
|
+
output.print Color.wrap('F', :failure)
|
29
30
|
end
|
30
31
|
|
31
32
|
def example_group_started(event)
|
32
33
|
if @group_level.zero?
|
33
34
|
output.print "#{event.group.description} "
|
34
|
-
@failure_output = []
|
35
35
|
@start_time = Time.now
|
36
36
|
end
|
37
|
+
|
37
38
|
@group_level += 1
|
38
39
|
end
|
39
40
|
|
40
41
|
def example_group_finished(event)
|
41
42
|
@group_level -= 1
|
43
|
+
|
42
44
|
if @group_level.zero?
|
43
45
|
print_elapsed_time output, @start_time
|
44
46
|
output.puts
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
dump_pending_fixed(example, @index_offset + index)
|
49
|
-
else
|
50
|
-
dump_failure(example, @index_offset + index)
|
51
|
-
end
|
52
|
-
dump_backtrace(example)
|
48
|
+
failed_notifications.each_with_index do |failure, index|
|
49
|
+
output.puts failure.fully_formatted(@index_offset + index + 1)
|
53
50
|
end
|
54
|
-
@index_offset += failed_examples.size
|
55
|
-
@cumulative_failed_examples += failed_examples
|
56
|
-
failed_examples.clear
|
57
|
-
end
|
58
|
-
end
|
59
51
|
|
60
|
-
|
61
|
-
|
52
|
+
@index_offset += failed_notifications.size
|
53
|
+
failed_notifications.clear
|
54
|
+
end
|
62
55
|
end
|
63
56
|
|
64
|
-
def
|
65
|
-
output.puts
|
66
|
-
output.puts fixed_color("#{long_padding}Expected pending '#{example.execution_result.pending_message}' to fail. No Error was raised.")
|
57
|
+
def dump_summary(summary)
|
58
|
+
output.puts summary.fully_formatted
|
67
59
|
end
|
68
60
|
|
69
|
-
def
|
70
|
-
|
71
|
-
|
61
|
+
def seed(notification)
|
62
|
+
return unless notification.seed_used?
|
63
|
+
output.puts notification.fully_formatted
|
72
64
|
end
|
73
65
|
end
|
74
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fivemat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pope
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: MiniTest/RSpec/Cucumber formatter that gives each test file its own line
|
14
14
|
of dots
|