rspec-pride 3.1.1 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7247a7e9335c493a33347292e4f7ea2075c59932
4
- data.tar.gz: ae2da357d5483202ba46efd0b080bd293394bc32
3
+ metadata.gz: 2ea9d3a7b46bb90ef41c94414ce46bd4f2cf0194
4
+ data.tar.gz: 358bde73990d306aca4465ae28710cf8708d3c03
5
5
  SHA512:
6
- metadata.gz: 78cf66061af9d7a336f6796cb26ec01fbfb77c74d26b9564f73298fcc78d1b9ee550384b661467edb60d0b8ff8e10fbdd1d5a215572165c04fb8da1d725468c9
7
- data.tar.gz: b71bd4d42097233c513589124b2355ba8fda317cca95dc1f161fea90ed7b314a83ff31e172b285ac5cbeb8436785be20374dd9edbc6c90cb62ceff57b5a4bcb0
6
+ metadata.gz: e911a1751f0f5e675d028b48361480ae276ce6c543a6ff09932769db113516dd8472c22cb6e789b579b065315413274332b7e5c543f7c53c7aa543e65e5a51dd
7
+ data.tar.gz: 90007878ebb8f52da2a3149d1643e5e5edcf5a68be2202b9f43b0f45c199dcf2845a36a5e03f9a60eb0d9995f128cede649d8bde385ab4655bf1e3c67f02a832
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -2,9 +2,10 @@
2
2
 
3
3
  Take pride in your test output!
4
4
 
5
- Mimics the functionality of minitest/pride for RSpec 3
5
+ Mimics the functionality of [minitest/pride](https://github.com/seattlerb/minitest/blob/master/lib/minitest/pride_plugin.rb) for RSpec 3
6
6
 
7
- ![Prideful Tests](https://github.com/ferrous26/rspec-pride/blob/master/resources/pride.png)
7
+ ![Prideful Failure](https://github.com/ferrous26/rspec-pride/blob/master/resources/pride_failure.png)
8
+ ![Prideful Success](https://github.com/ferrous26/rspec-pride/blob/master/resources/pride_success.png)
8
9
 
9
10
 
10
11
  ## How to use Rspec-pride
@@ -34,8 +35,7 @@ just as well in this case.
34
35
 
35
36
  ## Copyright
36
37
 
37
- Copyright (c) 2011-2015 Mark Rada. See LICENSE.txt for further details.
38
+ Copyright (c) 2011-2016 Mark Rada. See LICENSE.txt for further details.
38
39
 
39
40
 
40
41
  [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ferrous26/rspec-pride/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
41
-
data/Rakefile CHANGED
@@ -3,14 +3,16 @@ require 'rubygems'
3
3
  task :default => :test
4
4
  task :test => :spec
5
5
 
6
- if RUBY_ENGINE == 'macruby'
7
- require 'rake/compiletask'
8
- Rake::CompileTask.new
9
- end
10
6
 
11
7
  require 'rspec/core/rake_task'
8
+ ['failure', 'success'].each do |name|
9
+ RSpec::Core::RakeTask.new("spec_#{name}") do |spec|
10
+ spec.pattern = FileList["spec/#{name}_spec.rb"]
11
+ end
12
+ end
13
+
12
14
  RSpec::Core::RakeTask.new(:spec) do |spec|
13
- spec.pattern = FileList['spec/**/*_spec.rb']
15
+ spec.pattern = FileList["spec/{success,failure}_spec.rb"]
14
16
  end
15
17
 
16
18
  require 'rubygems/package_task'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/core'
2
4
 
3
5
  class PrideFormatter < RSpec::Core::Formatters::ProgressFormatter
@@ -29,10 +31,28 @@ class PrideFormatter < RSpec::Core::Formatters::ProgressFormatter
29
31
  output.print pending
30
32
  end
31
33
 
32
- def dump_summary(summary)
33
- icing = 'Fabulous tests'.split(//).map {|x| rainbow x }.join
34
- output.print "\n\n#{icing} in #{summary.formatted_duration}\n" +
35
- "#{summary.example_count} examples, #{summary.failure_count} failures, #{summary.pending_count} pending\n\n"
34
+ def dump_summary summary
35
+ icing = 'Fabulous tests'.split(//).map { |x| rainbow x }.join
36
+
37
+ summary_text = "#{summary.example_count} examples, " \
38
+ "#{summary.failure_count} failures, " \
39
+ "#{summary.pending_count} pending"
40
+
41
+ formatted_summary =
42
+ if summary.failure_count.to_i.zero?
43
+ if summary.pending_count.zero?
44
+ good summary_text
45
+ else
46
+ caution summary_text
47
+ end
48
+ else
49
+ bad summary_text
50
+ end
51
+
52
+ output.print <<-TEXT
53
+ #{icing} in #{summary.duration}
54
+ #{formatted_summary}
55
+ TEXT
36
56
  end
37
57
 
38
58
  private
@@ -41,6 +61,18 @@ class PrideFormatter < RSpec::Core::Formatters::ProgressFormatter
41
61
  def pending; "\e[40m\e[37mP#{NND}"; end
42
62
  def failure; "\e[41m\e[37mF#{NND}"; end
43
63
 
64
+ def good(str)
65
+ "#{ESC}31m#{ESC}32m#{str}#{NND}"
66
+ end
67
+
68
+ def bad(str)
69
+ "#{ESC}32m#{ESC}31m#{str}#{NND}"
70
+ end
71
+
72
+ def caution(str)
73
+ "#{ESC}33m#{ESC}33m#{str}#{NND}"
74
+ end
75
+
44
76
  if ENV['TERM'] =~ /^xterm(-256color)?$/
45
77
 
46
78
  PI_3 = Math::PI / 3
@@ -0,0 +1,25 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'rspec/pride'
3
+ require 'stringio'
4
+
5
+ describe 'Some class' do
6
+
7
+ 8.times do |n|
8
+ it "passes #{n}" do
9
+ expect(1).to eq 1
10
+ end
11
+ end
12
+
13
+ it 'should be pending'
14
+
15
+ it 'should fail' do
16
+ expect(1).to eq 0
17
+ end
18
+
19
+ 4.times do |n|
20
+ it "passed #{n}" do
21
+ expect(true).to eq true
22
+ end
23
+ end
24
+
25
+ end
@@ -3,32 +3,22 @@ require 'rspec/pride'
3
3
  require 'stringio'
4
4
 
5
5
  RSpec.configure do |c|
6
- if ENV['TEST_PROFILING']
7
- c.profile_examples = true
8
- end
6
+ c.profile_examples = true
9
7
  end
10
8
 
11
9
  describe 'Some class' do
12
10
 
13
- 50.times do |n|
11
+ 16.times do |n|
14
12
  it "passes #{n}" do
15
13
  expect(1).to eq 1
16
14
  end
17
15
  end
18
16
 
19
- it 'should be pending'
20
-
21
- if ENV['TEST_PROFILING']
22
- it 'should be really slow' do
23
- sleep 2
24
- end
25
- else
26
- it 'should fail' do
27
- expect(1).to eq 0
28
- end
17
+ it 'should be really slow' do
18
+ sleep 2
29
19
  end
30
20
 
31
- 10.times do |n|
21
+ 4.times do |n|
32
22
  it "passed #{n}" do
33
23
  expect(true).to eq true
34
24
  end
@@ -0,0 +1,13 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'rspec/pride'
3
+ require 'stringio'
4
+
5
+ describe 'Some class' do
6
+
7
+ 64.times do |n|
8
+ it "passes #{n}" do
9
+ expect(1).to eq 1
10
+ end
11
+ end
12
+
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-pride
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rada
@@ -12,25 +12,25 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMRMwEQYDVQQDDAptYXJr
14
14
  cmFkYTI2MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNj
15
- b20wHhcNMTUwMjAyMDQ1MTA3WhcNMTYwMjAyMDQ1MTA3WjBBMRMwEQYDVQQDDApt
15
+ b20wHhcNMTYwNDA1MjI0MzM0WhcNMTcwNDA1MjI0MzM0WjBBMRMwEQYDVQQDDApt
16
16
  YXJrcmFkYTI2MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
17
- FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDeOx6HTOprjEsz
18
- FP/7agdlejgztRqyQhyqEoAQIBAlerdVGNbciMOW8+KWRd6SnlzRvk155o7I3xM7
19
- AGtSWqEHTUifyXGYKZF/UW/ELvrXNUk1wcy+D3UsiKf0jqON+fmq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4t4k3H+EYt2mwKbYIu2PHSU
28
- RaJtAjkax8/PgwQeBx2CVdpX+p5IVk0hZ4nH+zd9bZpztQnl6oCakHMOSb3ds0er
29
- zLmvMhkYClNmjcgggy+UoXzsOACGwwNe+iyydlJujz3JjLmODpiet0aSZEx4ZSdk
30
- 0WHcut5WdsOnrIkVkbvgxDUtQclWeulaIRqGkvnajtp2FJdRsi/n8zo3nAfeR6QM
31
- vkReJWGG0H8U/JJqYfQBZopYOUMnLJQxN+NA4w==
26
+ 9w0BAQUFAAOCAQEAx10L50qxEmnN1g7TlXuyeNWhXRdyeUi1m+O/0pZ6mWyK4R3U
27
+ DikOqyDBNZca9qCjrixFkUa6LRmDcu9hROx4gEVCBvJDll/+ClrGoapdK7+n83NU
28
+ jrMTyYo70vcUcdIXZv9s70J2mkexzeP/sG5CSPK6GdWCUZhK0JPxJ0hPWYQXn0Mt
29
+ unoLL5ZbXrh0/7SxYbvanF5n62cB8pUoyyV347SMuvZdkoa+TqiEJB0DGLXQQEfC
30
+ TsqvFn8KlnBfEw5EV7xI7Y7q8ocIJzjuduc+8jPI0HQmo6xUk5fNvYF9TM3xTNmg
31
+ 3JsffvFA/rXBqazUm71ulf3bIMvWdL0Zui8wCw==
32
32
  -----END CERTIFICATE-----
33
- date: 2015-12-01 00:00:00.000000000 Z
33
+ date: 2016-04-05 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rspec
@@ -56,7 +56,9 @@ files:
56
56
  - README.markdown
57
57
  - Rakefile
58
58
  - lib/rspec/pride.rb
59
- - spec/pride_spec.rb
59
+ - spec/failure_spec.rb
60
+ - spec/profiling_spec.rb
61
+ - spec/success_spec.rb
60
62
  homepage: http://github.com/ferrous26/rspec-pride
61
63
  licenses:
62
64
  - MIT
@@ -77,9 +79,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
79
  version: '0'
78
80
  requirements: []
79
81
  rubyforge_project:
80
- rubygems_version: 2.4.3
82
+ rubygems_version: 2.5.1
81
83
  signing_key:
82
84
  specification_version: 4
83
85
  summary: Take pride in your testing
84
86
  test_files:
85
- - spec/pride_spec.rb
87
+ - spec/failure_spec.rb
88
+ - spec/profiling_spec.rb
89
+ - spec/success_spec.rb
metadata.gz.sig CHANGED
Binary file