luna-rspec-formatters 1.0.3 → 1.1.0

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: 3903fe6e4975295deddbe2bb4bfb2b1aba6552af
4
- data.tar.gz: 21c1f8e7750512abbcb8f8053752e8bcf2db211c
3
+ metadata.gz: cda1f916da2f00b29f5bf0bd3dd447f1a1053d95
4
+ data.tar.gz: 46a134b7f2884a41e1ad9758f87db73d880ede7f
5
5
  SHA512:
6
- metadata.gz: 62b2e54bb570c43185b161abba4e2adea4da9e5a976bcfa1a1c6146b3b7e12070ec9858376083885854d98114f84c567955bb35d2ec635d35640ac89d1f0294f
7
- data.tar.gz: 24b9c8e8d675a83e46c832daed97061ee5a183e738e89778ae274b13858c951095557b66bfc6550cf7861254e6f010aad287b62014095c0f10743e61613a1861
6
+ metadata.gz: efb7ad0863ea147a664fbbb0d22b15e0e512fcde789601953b5a34d018842176ce99cf95f008c4bfe46f12eb608af2992a5e985e8e9aee071f2710849bd19c3b
7
+ data.tar.gz: 5a74f5f159d2d6bfa68f4c33ce43d206b33330e2645e7cae407eb11328fdde8f4c2e98e6c02fa2b8980221e8feb8c890feb07ebeb4930b3438f3202ea5809437
@@ -21,15 +21,17 @@ module Luna
21
21
 
22
22
  def dump_summary(duration, total, failures, pending)
23
23
  super
24
- Libnotify.new do |notify|
25
- notify.summary = "RSpec Test Results"
26
- notify.urgency = :critical
27
- notify.transient = true
28
- notify.append = true
29
- notify.timeout = 1
30
- notify.body = \
31
- "Passed: #{total - failures}, Failed: #{failures}, Pending: #{pending}"
32
- end.show!
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
33
35
  end
34
36
  end
35
37
  end
@@ -6,45 +6,25 @@ module Luna
6
6
  module Formatters
7
7
  class Documentation < Base
8
8
 
9
- def example_passed
9
+ def example_passed(e)
10
10
  super(e)
11
- blank_line?
12
- success_color(print_description(e))
11
+ print_description(e, :success)
13
12
  end
14
13
 
15
- def example_failed
14
+ def example_failed(e)
16
15
  super(e)
17
- blank_line?
18
- failure_color(print_description(e))
16
+ print_description(e, :failure)
19
17
  end
20
18
 
21
- def example_pending
19
+ def example_pending(e)
22
20
  super(e)
23
- blank_line?
24
- pending_color(print_description(e))
21
+ print_description(e, :pending)
25
22
  end
26
23
 
27
24
  # -------------------------------------------------------------
28
25
 
29
- def highlight_graves(text)
30
- text.gsub(/`([^`]+)`/) { syntax_highlight($1) }
31
- end
32
-
33
- def syntax_highlight(text)
34
- CodeRay.scan(text, :ruby).term
35
- end
36
-
37
-
38
- def highlight_methods(text)
39
- text.gsub(/(#|\.)([a-z0-9_]+)/) { $1.white + $2.magenta }
40
- end
41
-
42
- # -------------------------------------------------------------
43
-
44
- def print_description(example)
45
- constant = example.full_description.chomp(example.description)
46
- output.print " " + highlight_methods(syntax_highlight(constant))
47
- output.print highlight_graves(example.description) + ":"
26
+ def print_description(example, type)
27
+ output.print send(:"#{type}_color", "\t" + example.full_description + "\n")
48
28
  end
49
29
  end
50
30
  end
@@ -1,7 +1,7 @@
1
1
  module Luna
2
2
  module Rspec
3
3
  module Formatters
4
- VERSION = "1.0.3"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luna-rspec-formatters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.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-02-24 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libnotify