Bacon_Colored 0.1.1 → 0.1.2

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: ab4a15c1e75784ed61227af2ab76555812f5f5af
4
- data.tar.gz: 9ddb7e1543c643485694eff22cab36677639cd18
3
+ metadata.gz: 2ec64fb22d07fbe9ecabf76e5f4f06ff046e73f1
4
+ data.tar.gz: 8ea0985d3cc853b760c69fe6ec6a5c7a1fc4d3eb
5
5
  SHA512:
6
- metadata.gz: 276fa7cb5e7fbc89b71199b13a8f3bb65ff19a1af69c9cd55e63bd1d2acc8698c5bcc5c07a55931b01e4ef6e01a75f58e6c31117f00a027499564a67d5901d5a
7
- data.tar.gz: 346586b753d36f839db18588961b83dae3a13621d896d113b291bc7803c898ecc6058f91cb11423bb6a191acd249e652ca0c620648aa7df8cbaf27a363f388a4
6
+ metadata.gz: eef874770e791d847501c6a188041e41f5190acebe3333fa0a1eeb2b743e01718d22611b9c6a6e79999bcfddb0e4db7ca24348a6343424ae07402dcac36658d0
7
+ data.tar.gz: 587fd6f8a39b4598b61cff6ecd073516dcde2f1e2034d7d5597219fdcaa755cad609cc12219e51e6b84cffad4d5408260c0b60abcca5be42c72461ca3cdc3f3e
@@ -7,10 +7,10 @@ Gem::Specification.new do |s|
7
7
  s.authors = ["da99"]
8
8
  s.email = ["i-hate-spam-45671204@mailinator.com"]
9
9
  s.homepage = "https://github.com/da99/Bacon_Colored"
10
- s.summary = %q{Adds color to your spec runs.}
10
+ s.summary = %q{Adds color to your Bacon runs.}
11
11
  s.description = %q{
12
- Adds color to your spec runs.
13
- Inspired by GreenEggs: https://github.com/fantasticmf/greeneggs
12
+ require "bacon";
13
+ require "Bacon_Colored";
14
14
  }
15
15
 
16
16
  s.rubyforge_project = "Bacon_Colored"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/bin/test ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+ # -*- bash -*-
3
+ #
4
+ #!/usr/bin/env node
5
+ # -*- js -*-
6
+ #
7
+ #!/usr/bin/env lua
8
+ #
9
+ #
10
+ set -u -e -o pipefail
11
+
12
+ bundle exec bacon spec/main.rb
13
+
14
+
data/lib/Bacon_Colored.rb CHANGED
@@ -29,12 +29,15 @@ module Bacon
29
29
  def handle_summary
30
30
  specs, reqs, fails, errs = Counter.values_at(:specifications, :requirements, :failed, :errors)
31
31
  all_pass = reqs > 1 && (fails == errs) && (errs == 0)
32
+ single_pass = reqs == 1 && specs == 1 && (errs == 0) && (fails == errs)
32
33
 
33
34
  print ErrorLog if Backtraces
34
35
 
35
36
  print "%d specifications (%d requirements)".send(all_pass ? :green : :to_s ) % [ specs, reqs ]
36
37
 
37
- if all_pass
38
+ if single_pass
39
+ print( ". Just one requirement and it passes. ".green )
40
+ elsif all_pass
38
41
  print( ". All pass. ".green )
39
42
  else
40
43
  print ", "
data/spec/main.rb CHANGED
@@ -1,32 +1,38 @@
1
1
  # -*- encoding : utf-8 -*-
2
- #
2
+ #
3
3
  require File.expand_path('spec/helper')
4
4
  require 'Bacon_Colored'
5
5
 
6
6
  describe "Bacon_Colored" do
7
-
7
+
8
8
  before do
9
9
  @run = lambda { |name|
10
10
  %x! bundle exec bacon spec/tests/#{name}.rb!
11
11
  }
12
12
  end
13
-
13
+
14
+ it("prints green when: 1 requirement and it passes") {
15
+ result = @run.call("pass")
16
+ target = "Just one requirement and it passes."
17
+ result[ target ].should.be == target
18
+ }
19
+
14
20
  it("prints green when tests pass.") {
15
21
  target = "\e[32m✓ \e[0mpasses"
16
22
  result = @run.call("pass")
17
23
  result[ target ].should.be == target
18
24
  }
19
-
25
+
20
26
  it("prints red when tests fail.") {
21
27
  target = "\e[31m✗ \e[0mfails\e[31m [FAILED]\e[0m"
22
28
  @run.call("fail")[ target ].should == target
23
29
  }
24
-
30
+
25
31
  it("prints green/red when tests pass/fail.") {
26
32
  out = @run.call("pass_fail")
27
33
  out["\e[32m✓ \e[0mpasses"].should.not.be == nil
28
34
  out["\e[31m✗ \e[0mfails\e[31m [FAILED]\e[0m"].should.not.be == nil
29
35
  }
30
-
36
+
31
37
  end # === describe Bacon_Colored
32
38
 
data/spec/tests/pass.rb CHANGED
@@ -2,9 +2,9 @@ require File.expand_path('spec/helper')
2
2
  require 'Bacon_Colored'
3
3
 
4
4
  describe "All true:" do
5
-
5
+
6
6
  it "passes" do
7
7
  true.should.be == true
8
8
  end
9
-
9
+
10
10
  end # === describe All true:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Bacon_Colored
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - da99
@@ -52,11 +52,11 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: "\n Adds color to your spec runs.\n Inspired by GreenEggs: https://github.com/fantasticmf/greeneggs\n
56
- \ "
55
+ description: "\n require \"bacon\";\n require \"Bacon_Colored\";\n "
57
56
  email:
58
57
  - i-hate-spam-45671204@mailinator.com
59
- executables: []
58
+ executables:
59
+ - test
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
@@ -68,6 +68,7 @@ files:
68
68
  - README.md
69
69
  - Rakefile
70
70
  - VERSION
71
+ - bin/test
71
72
  - lib/Bacon_Colored.rb
72
73
  - spec/helper.rb
73
74
  - spec/main.rb
@@ -96,5 +97,5 @@ rubyforge_project: Bacon_Colored
96
97
  rubygems_version: 2.0.7
97
98
  signing_key:
98
99
  specification_version: 4
99
- summary: Adds color to your spec runs.
100
+ summary: Adds color to your Bacon runs.
100
101
  test_files: []