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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.markdown +4 -4
- data/Rakefile +7 -5
- data/lib/rspec/pride.rb +36 -4
- data/spec/failure_spec.rb +25 -0
- data/spec/{pride_spec.rb → profiling_spec.rb} +5 -15
- data/spec/success_spec.rb +13 -0
- metadata +24 -20
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ea9d3a7b46bb90ef41c94414ce46bd4f2cf0194
|
4
|
+
data.tar.gz: 358bde73990d306aca4465ae28710cf8708d3c03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e911a1751f0f5e675d028b48361480ae276ce6c543a6ff09932769db113516dd8472c22cb6e789b579b065315413274332b7e5c543f7c53c7aa543e65e5a51dd
|
7
|
+
data.tar.gz: 90007878ebb8f52da2a3149d1643e5e5edcf5a68be2202b9f43b0f45c199dcf2845a36a5e03f9a60eb0d9995f128cede649d8bde385ab4655bf1e3c67f02a832
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.markdown
CHANGED
@@ -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
|
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-
|
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[
|
15
|
+
spec.pattern = FileList["spec/{success,failure}_spec.rb"]
|
14
16
|
end
|
15
17
|
|
16
18
|
require 'rubygems/package_task'
|
data/lib/rspec/pride.rb
CHANGED
@@ -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
|
33
|
-
icing = 'Fabulous tests'.split(//).map {|x| rainbow x }.join
|
34
|
-
|
35
|
-
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
21
|
+
4.times do |n|
|
32
22
|
it "passed #{n}" do
|
33
23
|
expect(true).to eq true
|
34
24
|
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.
|
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
|
-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o70vcUcdIXZv9s70J2mkexzeP/sG5CSPK6GdWCUZhK0JPxJ0hPWYQXn0Mt
|
29
|
+
unoLL5ZbXrh0/7SxYbvanF5n62cB8pUoyyV347SMuvZdkoa+TqiEJB0DGLXQQEfC
|
30
|
+
TsqvFn8KlnBfEw5EV7xI7Y7q8ocIJzjuduc+8jPI0HQmo6xUk5fNvYF9TM3xTNmg
|
31
|
+
3JsffvFA/rXBqazUm71ulf3bIMvWdL0Zui8wCw==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
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/
|
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.
|
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/
|
87
|
+
- spec/failure_spec.rb
|
88
|
+
- spec/profiling_spec.rb
|
89
|
+
- spec/success_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|