konacha 3.2.3 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +4 -0
- data/konacha.gemspec +1 -1
- data/lib/konacha/formatter.rb +13 -4
- data/spec/formatter_spec.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab4c0793bf058462bd228a1bc1d8b4cdd17ad53c
|
4
|
+
data.tar.gz: 998084e6c20558f96d810d6628b1e7a68cd06142
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5ecc759609c4649018a094f177892dd003d6f15a6fcc61871a9eca22b09d2956d9a76ba9be6a4d1d552de3feda2a5ce4b82516885094394fe9bbeb0605fd5d0
|
7
|
+
data.tar.gz: 02c621f71b179ebbec470e7ec420ff0d261213f6b1df54023304685807e829dd9028f4f8428c505edd76d7026bc58af43f6fb74f18d5bfec48e6a82d91a68ced
|
data/History.md
CHANGED
data/konacha.gemspec
CHANGED
@@ -17,7 +17,7 @@ the asset pipeline and engines.}
|
|
17
17
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
18
|
gem.name = "konacha"
|
19
19
|
gem.require_paths = ["lib"]
|
20
|
-
gem.version = "3.2.
|
20
|
+
gem.version = "3.2.4"
|
21
21
|
gem.license = "MIT"
|
22
22
|
|
23
23
|
gem.add_dependency "railties", ">= 3.1", "< 5"
|
data/lib/konacha/formatter.rb
CHANGED
@@ -15,17 +15,17 @@ module Konacha
|
|
15
15
|
|
16
16
|
def example_passed(example)
|
17
17
|
@examples << example
|
18
|
-
io.write(
|
18
|
+
io.write(with_color('.', :green))
|
19
19
|
end
|
20
20
|
|
21
21
|
def example_failed(example)
|
22
22
|
@examples << example
|
23
|
-
io.write(
|
23
|
+
io.write(with_color('F', :red))
|
24
24
|
end
|
25
25
|
|
26
26
|
def example_pending(example)
|
27
27
|
@examples << example
|
28
|
-
io.write(
|
28
|
+
io.write(with_color('P', :yellow))
|
29
29
|
end
|
30
30
|
|
31
31
|
def example_group_finished(group); end
|
@@ -74,7 +74,16 @@ module Konacha
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def pending_message(example)
|
77
|
-
" Pending: #{example.full_description}"
|
77
|
+
with_color(" Pending: #{example.full_description}", :yellow)
|
78
|
+
end
|
79
|
+
|
80
|
+
def color_enabled?
|
81
|
+
io.tty?
|
82
|
+
end
|
83
|
+
|
84
|
+
def with_color(text, color)
|
85
|
+
return text unless color_enabled?
|
86
|
+
text.colorize(color)
|
78
87
|
end
|
79
88
|
end
|
80
89
|
end
|
data/spec/formatter_spec.rb
CHANGED
@@ -9,11 +9,18 @@ describe Konacha::Formatter do
|
|
9
9
|
subject.send(method, nil)
|
10
10
|
subject.examples.should be_present
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
it "outputs the dot" do
|
14
14
|
subject.send(method, nil)
|
15
15
|
io.rewind
|
16
|
-
io.read.should
|
16
|
+
io.read.should eql(dot)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "uses colors when tty" do
|
20
|
+
io.stub(:tty?).and_return(true)
|
21
|
+
subject.send(method, nil)
|
22
|
+
io.rewind
|
23
|
+
io.read.should match(/\e\[0;\d{2};49m#{dot}\e\[0m/)
|
17
24
|
end
|
18
25
|
end
|
19
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konacha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Firebaugh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|