nyan-cat-formatter 0.10.1 → 0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ module NyanCatFormat
2
+ module InstaFail
3
+ def example_failed( failure )
4
+ output.puts [ eol, "", failure.fully_formatted( @failure_count ), "" ].join( "\n" )
5
+ super
6
+ end
7
+ end
8
+ end
@@ -65,7 +65,6 @@ module NyanCat
65
65
  end
66
66
 
67
67
  def progress_lines
68
- padding = @example_count.to_s.length * 2 + 2
69
68
  [
70
69
  nyan_trail.split("\n").each_with_index.inject([]) do |result, (trail, index)|
71
70
  value = "#{scoreboard[index]}/#{@example_count}:"
@@ -130,7 +129,7 @@ module NyanCat
130
129
  def nyan_trail
131
130
  marks = @example_results.each_with_index.map{ |mark, i| highlight(mark) * example_width(i) }
132
131
  marks.shift(current_width - terminal_width) if current_width >= terminal_width
133
- nyan_cat_lines = nyan_cat.split("\n").each_with_index.map do |line, index|
132
+ nyan_cat.split("\n").each_with_index.map do |line, index|
134
133
  format("%s#{line}", marks.join)
135
134
  end.join("\n")
136
135
  end
@@ -58,7 +58,6 @@ class RSpec3 < RSpec::Core::Formatters::BaseTextFormatter
58
58
 
59
59
  def dump_summary(notification)
60
60
  duration = notification.duration
61
- failure_count = notification.failure_count
62
61
  summary = "\nYou've Nyaned for #{format_duration(duration)}\n".split(//).map { |c| rainbowify(c) }
63
62
  output.puts summary.join
64
63
  output.puts notification.fully_formatted
@@ -0,0 +1,13 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'nyan_cat_formatter'
3
+ require 'nyan_cat_format/verbose'
4
+ require 'nyan_cat_format/insta_fail'
5
+ require 'nyan_cat_format/helpers'
6
+
7
+ NyanCatInstaFailFormatter = Class.new(NyanCatFormatter) do
8
+ extend NyanCatFormat::Helpers
9
+ include NyanCatFormat::InstaFail
10
+
11
+ RSpec::Core::Formatters.register(self, :example_passed, :example_pending,
12
+ :example_failed, :start_dump, :start) if rspec_3_or_greater?
13
+ end
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "nyan-cat-formatter"
5
- s.version = "0.10.1"
5
+ s.version = "0.11"
6
6
  s.authors = ["Matt Sears"]
7
7
  s.email = ["matt@mattsears.com"]
8
8
  s.homepage = "https://github.com/mattsears/nyan-cat-formatter"
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+ require 'stringio'
3
+ require 'nyan_cat_insta_fail_formatter'
4
+
5
+ describe NyanCatInstaFailFormatter do
6
+ before(:all) do
7
+ @output = StringIO.new
8
+ @formatter = described_class.new(@output)
9
+ end
10
+
11
+ before(:each) do
12
+ @formatter.start(1)
13
+ end
14
+
15
+ it 'displays failed tests immediately' do
16
+ example = double :example
17
+ expect(example).to receive( :fully_formatted ).and_return( "FAIL" )
18
+ @formatter.example_failed(example)
19
+ expect( @output.string ).to include('FAIL')
20
+ end
21
+
22
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nyan-cat-formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: '0.11'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-30 00:00:00.000000000 Z
12
+ date: 2014-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -78,6 +78,7 @@ files:
78
78
  - gemfiles/rspec2
79
79
  - gemfiles/rspec2.lock
80
80
  - lib/nyan_cat_format/helpers.rb
81
+ - lib/nyan_cat_format/insta_fail.rb
81
82
  - lib/nyan_cat_format/music.rb
82
83
  - lib/nyan_cat_format/verbose.rb
83
84
  - lib/nyan_cat_format/wide.rb
@@ -86,6 +87,7 @@ files:
86
87
  - lib/nyan_cat_formatter/rspec1.rb
87
88
  - lib/nyan_cat_formatter/rspec2.rb
88
89
  - lib/nyan_cat_formatter/rspec3.rb
90
+ - lib/nyan_cat_insta_fail_formatter.rb
89
91
  - lib/nyan_cat_music_formatter.rb
90
92
  - lib/nyan_cat_verbose_formatter.rb
91
93
  - lib/nyan_cat_wide_formatter.rb
@@ -93,6 +95,7 @@ files:
93
95
  - nyan-cat-formatter.gemspec
94
96
  - nyan_example.gif
95
97
  - spec/nyan_cat_formatter_spec.rb
98
+ - spec/nyan_cat_insta_fail_formatter_spec.rb
96
99
  - spec/nyan_cat_music_formatter_spec.rb
97
100
  - spec/nyan_cat_verbose_formatter_spec.rb
98
101
  - spec/nyan_cat_wide_formatter_spec.rb
@@ -123,6 +126,7 @@ specification_version: 3
123
126
  summary: Nyan Cat inspired RSpec formatter!
124
127
  test_files:
125
128
  - spec/nyan_cat_formatter_spec.rb
129
+ - spec/nyan_cat_insta_fail_formatter_spec.rb
126
130
  - spec/nyan_cat_music_formatter_spec.rb
127
131
  - spec/nyan_cat_verbose_formatter_spec.rb
128
132
  - spec/nyan_cat_wide_formatter_spec.rb