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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0dff3961f1d0a9f6b0d5ff9b998f4a28f03212f3
4
- data.tar.gz: 09b8a15c7e4a0f01fa2dc9b53f29e902d006f38c
3
+ metadata.gz: 2a5b609f9df1bdb02278cb9d1c00ae1795ed939f
4
+ data.tar.gz: ae9f16c478877ad98754b952d5749e60d807da89
5
5
  SHA512:
6
- metadata.gz: cc2ed4bcf2da8622e037d07172a446163012e10117ccbf1416a335f1a35b6001fa983ec6899a2a23adf2365a301f268c5357c13cd48316acec73553fe9823c33
7
- data.tar.gz: b8071efedf092f4a96539edbb63d7f83fe3aeb81910ecb8ad344edf8e5fc859c703054a6d29cfda1d0768c9c3df14428e1b1cb9ae92fe91494a3bb24c7f89bf4
6
+ metadata.gz: 388ae947ef201509b647deb0204f16ec428c433ee74ef3bfb8d946795ad2f9311e0ea8cb15ffb1ea5c585115357627d090aafa762652bfd6e944455f66d65752
7
+ data.tar.gz: 5cb2396594c40a0f676648a17f0846ff9a7b83654fc7822e325fba0240c1054c3eb7f4bc49e1732aeea5205f8d98e862b75d3098fd55852c379df7230d8ea133
@@ -12,5 +12,5 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "fivemat"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = '1.3.0'
15
+ gem.version = '1.3.1'
16
16
  end
@@ -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
- :dump_pending_fixed,
25
- :dump_summary
24
+ :dump_summary,
25
+ :seed
26
26
  end
27
27
 
28
28
  def self.new(*args)
@@ -1,74 +1,66 @@
1
- require 'rspec/core/formatters/base_text_formatter'
1
+ require 'rspec/core/formatters/console_codes'
2
2
 
3
3
  module Fivemat
4
- class RSpec3 < ::RSpec::Core::Formatters::BaseTextFormatter
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
- super(output)
11
+ @output = output
11
12
  @group_level = 0
12
13
  @index_offset = 0
13
- @cumulative_failed_examples = []
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 success_color('.')
20
+ output.print Color.wrap('.', :success)
19
21
  end
20
22
 
21
23
  def example_pending(notification)
22
- super
23
- output.print pending_color('*')
24
+ output.print Color.wrap('*', :pending)
24
25
  end
25
26
 
26
- def example_failed(event)
27
- super
28
- output.print failure_color('F')
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
- failed_examples.each_with_index do |example, index|
47
- if pending_fixed?(example)
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
- def pending_fixed?(example)
61
- example.execution_result.pending_fixed?
52
+ @index_offset += failed_notifications.size
53
+ failed_notifications.clear
54
+ end
62
55
  end
63
56
 
64
- def dump_pending_fixed(example, index)
65
- output.puts "#{short_padding}#{index.next}) #{example.full_description} FIXED"
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 dump_summary(*args)
70
- @failed_examples = @cumulative_failed_examples
71
- super
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.0
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-03-30 00:00:00.000000000 Z
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