luna-rspec-formatters 1.1.1 → 1.2.0
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/Readme.md +4 -3
- data/lib/luna/rspec/formatters/checks.rb +27 -6
- data/lib/luna/rspec/formatters/documentation.rb +29 -8
- data/lib/luna/rspec/formatters/version.rb +1 -1
- metadata +4 -19
- data/lib/luna/rspec/formatters/base.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d260008f59f012a3f874a2099eefbc8ba1e8b0ff
|
4
|
+
data.tar.gz: 4156fcc50acc460f25bb7820e42a95c704de8976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74b57135da28127751f86ebe57020fbd5acc31bb8151100b380ecac9c2476240eea6c045e2f28256b95f78763784da198c41949a5532932e111e22c0818249fb
|
7
|
+
data.tar.gz: 1ba031c1bcc936ef41cc698bf799f9a9f18d17873829f312403b581ce4e4cd1eb822f8e281306f9bbe3001b899186a8e7d9f9ef85138d4e285e195ffca595b2e
|
data/Readme.md
CHANGED
@@ -4,9 +4,10 @@
|
|
4
4
|
gem "luna-rspec-formatters"
|
5
5
|
```
|
6
6
|
|
7
|
-
A set of `rspec` formatters that design things the way I like them. `Doc2` is
|
8
|
-
that outputs the full description as a single line rather than
|
9
|
-
`Checks` displays checkmark's and other UTF
|
7
|
+
A set of `rspec` formatters that design things the way I like them. `Doc2` is
|
8
|
+
a formatter that outputs the full description as a single line rather than
|
9
|
+
nesting like documentation and `Checks` displays checkmark's and other UTF
|
10
|
+
characters rather than dots.
|
10
11
|
|
11
12
|
```ruby
|
12
13
|
require "luna/rspec/formatters/checks"
|
@@ -1,21 +1,46 @@
|
|
1
|
-
|
1
|
+
require "rspec/core/formatters/base_text_formatter"
|
2
|
+
require "rspec/version"
|
2
3
|
|
3
4
|
module Luna
|
4
5
|
module RSpec
|
5
6
|
module Formatters
|
6
|
-
class Checks <
|
7
|
+
class Checks < ::RSpec::Core::Formatters::BaseTextFormatter
|
8
|
+
if ::RSpec::Version::STRING >= "3.0.0"
|
9
|
+
# Probably not available in the old version of RSpec.
|
10
|
+
::RSpec::Core::Formatters.register self, :start, :start_dump, \
|
11
|
+
:example_passed, :example_pending, :example_failed
|
12
|
+
end
|
13
|
+
|
14
|
+
def start(*args)
|
15
|
+
super
|
16
|
+
output.puts
|
17
|
+
end
|
18
|
+
|
19
|
+
# ---------------------------------------------------------------------
|
20
|
+
|
21
|
+
def start_dump
|
22
|
+
super
|
23
|
+
output.puts
|
24
|
+
end
|
25
|
+
|
26
|
+
# ---------------------------------------------------------------------
|
27
|
+
|
7
28
|
def example_passed(e)
|
8
29
|
super(e)
|
9
30
|
output.print("\s")
|
10
31
|
output.print(success_color("\u2713"))
|
11
32
|
end
|
12
33
|
|
34
|
+
# ---------------------------------------------------------------------
|
35
|
+
|
13
36
|
def example_failed(e)
|
14
37
|
super(e)
|
15
38
|
output.print("\s")
|
16
39
|
output.print(failure_color("\u2718"))
|
17
40
|
end
|
18
41
|
|
42
|
+
# ---------------------------------------------------------------------
|
43
|
+
|
19
44
|
def example_pending(e)
|
20
45
|
super(e)
|
21
46
|
output.print("\s")
|
@@ -25,7 +50,3 @@ module Luna
|
|
25
50
|
end
|
26
51
|
end
|
27
52
|
end
|
28
|
-
|
29
|
-
RSpec.configure do |config|
|
30
|
-
config.formatter = "Luna::RSpec::Formatters::Checks"
|
31
|
-
end
|
@@ -1,36 +1,57 @@
|
|
1
|
-
|
1
|
+
require "rspec/core/formatters/base_text_formatter"
|
2
|
+
require "rspec/version"
|
2
3
|
require "coderay"
|
3
4
|
|
4
5
|
module Luna
|
5
6
|
module RSpec
|
6
7
|
module Formatters
|
7
|
-
class Documentation <
|
8
|
+
class Documentation < ::RSpec::Core::Formatters::BaseTextFormatter
|
9
|
+
if ::RSpec::Version::STRING >= "3.0.0"
|
10
|
+
# Probably not available in the old version of RSpec.
|
11
|
+
::RSpec::Core::Formatters.register self, :start, :start_dump, \
|
12
|
+
:example_passed, :example_pending, :example_failed
|
13
|
+
end
|
14
|
+
|
15
|
+
def start(*args)
|
16
|
+
super
|
17
|
+
output.puts
|
18
|
+
end
|
19
|
+
|
20
|
+
# ---------------------------------------------------------------------
|
21
|
+
|
22
|
+
def start_dump
|
23
|
+
super
|
24
|
+
output.puts
|
25
|
+
end
|
26
|
+
|
27
|
+
# ---------------------------------------------------------------------
|
8
28
|
|
9
29
|
def example_passed(e)
|
10
30
|
super(e)
|
11
31
|
print_description(e, :success)
|
12
32
|
end
|
13
33
|
|
34
|
+
# ---------------------------------------------------------------------
|
35
|
+
|
14
36
|
def example_failed(e)
|
15
37
|
super(e)
|
16
38
|
print_description(e, :failure)
|
17
39
|
end
|
18
40
|
|
41
|
+
# ---------------------------------------------------------------------
|
42
|
+
|
19
43
|
def example_pending(e)
|
20
44
|
super(e)
|
21
45
|
print_description(e, :pending)
|
22
46
|
end
|
23
47
|
|
24
|
-
#
|
48
|
+
# ---------------------------------------------------------------------
|
25
49
|
|
26
50
|
def print_description(example, type)
|
27
|
-
output.print send(:"#{type}_color",
|
51
|
+
output.print send(:"#{type}_color",
|
52
|
+
"\t" + example.full_description + "\n")
|
28
53
|
end
|
29
54
|
end
|
30
55
|
end
|
31
56
|
end
|
32
57
|
end
|
33
|
-
|
34
|
-
RSpec.configure do |config|
|
35
|
-
config.formatter = "Luna::RSpec::Formatters::Documentation"
|
36
|
-
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luna-rspec-formatters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordon Bedwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: libnotify
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.8'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0.8'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rspec
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,7 +30,7 @@ dependencies:
|
|
44
30
|
- - "<="
|
45
31
|
- !ruby/object:Gem::Version
|
46
32
|
version: '3.1'
|
47
|
-
description:
|
33
|
+
description: RSpec formatters that are dedicated to Luna.
|
48
34
|
email:
|
49
35
|
- envygeeks@gmail.com
|
50
36
|
executables: []
|
@@ -54,7 +40,6 @@ files:
|
|
54
40
|
- Gemfile
|
55
41
|
- License
|
56
42
|
- Readme.md
|
57
|
-
- lib/luna/rspec/formatters/base.rb
|
58
43
|
- lib/luna/rspec/formatters/checks.rb
|
59
44
|
- lib/luna/rspec/formatters/documentation.rb
|
60
45
|
- lib/luna/rspec/formatters/version.rb
|
@@ -81,5 +66,5 @@ rubyforge_project:
|
|
81
66
|
rubygems_version: 2.2.2
|
82
67
|
signing_key:
|
83
68
|
specification_version: 4
|
84
|
-
summary:
|
69
|
+
summary: RSpec formatters dedicated to Luna.
|
85
70
|
test_files: []
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require "libnotify" unless ENV["LUNA_DISABLE_LIBNOTIFY"]
|
2
|
-
require "rspec/core/formatters/base_text_formatter"
|
3
|
-
|
4
|
-
# ----------------------------------------------------------------------------
|
5
|
-
# My RSpec formatters.
|
6
|
-
# ----------------------------------------------------------------------------
|
7
|
-
|
8
|
-
module Luna
|
9
|
-
module RSpec
|
10
|
-
module Formatters
|
11
|
-
class Base < ::RSpec::Core::Formatters::BaseTextFormatter
|
12
|
-
def start(*args)
|
13
|
-
super
|
14
|
-
output.puts
|
15
|
-
end
|
16
|
-
|
17
|
-
def start_dump
|
18
|
-
super
|
19
|
-
output.puts
|
20
|
-
end
|
21
|
-
|
22
|
-
def dump_summary(duration, total, failures, pending)
|
23
|
-
super
|
24
|
-
unless ENV["LUNA_DISABLE_LIBNOTIFY"]
|
25
|
-
Libnotify.new do |notify|
|
26
|
-
notify.summary = "RSpec Test Results"
|
27
|
-
notify.urgency = :critical
|
28
|
-
notify.transient = true
|
29
|
-
notify.append = true
|
30
|
-
notify.timeout = 1
|
31
|
-
notify.body = \
|
32
|
-
"Passed: #{total - failures}, Failed: #{failures}, Pending: #{pending}"
|
33
|
-
end.show!
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|