autotest-tmux 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/autotest-tmux.gemspec +14 -21
- data/lib/autotest/tmux.rb +17 -14
- data/spec/autotest-tmux_spec.rb +59 -1
- metadata +8 -30
- data/.gitignore +0 -22
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/autotest-tmux.gemspec
CHANGED
@@ -1,46 +1,39 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{autotest-tmux}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["MIKAMI Yoshiyuki"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-07-12}
|
13
13
|
s.description = %q{displays autotest/autospec progress on tmux status-right.}
|
14
14
|
s.email = %q{yoshuki@saikyoline.jp}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
"spec/spec_helper.rb"
|
21
|
+
"LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"autotest-tmux.gemspec",
|
26
|
+
"autotest/discover.rb",
|
27
|
+
"lib/autotest/tmux.rb",
|
28
|
+
"spec/autotest-tmux_spec.rb",
|
29
|
+
"spec/spec_helper.rb"
|
31
30
|
]
|
32
31
|
s.homepage = %q{http://github.com/yoshuki/autotest-tmux}
|
33
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
34
32
|
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version = %q{1.
|
33
|
+
s.rubygems_version = %q{1.7.2}
|
36
34
|
s.summary = %q{displays autotest/autospec progress on tmux status-right.}
|
37
|
-
s.test_files = [
|
38
|
-
"spec/autotest-tmux_spec.rb",
|
39
|
-
"spec/spec_helper.rb"
|
40
|
-
]
|
41
35
|
|
42
36
|
if s.respond_to? :specification_version then
|
43
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
37
|
s.specification_version = 3
|
45
38
|
|
46
39
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
data/lib/autotest/tmux.rb
CHANGED
@@ -68,7 +68,7 @@ class Autotest::Tmux
|
|
68
68
|
|
69
69
|
Autotest.add_hook :died do |at, *args|
|
70
70
|
message "Exception occured. (#{at.class})", :red
|
71
|
-
puts "Exception occured. (#{at.class}): #{args.first}"
|
71
|
+
puts "Exception occured. (#{at.class}): #{args.first}"
|
72
72
|
next false
|
73
73
|
end
|
74
74
|
|
@@ -92,36 +92,39 @@ class Autotest::Tmux
|
|
92
92
|
next false
|
93
93
|
end
|
94
94
|
|
95
|
-
|
96
|
-
next false unless execute?
|
97
|
-
|
98
|
-
output = at.results.join
|
99
|
-
class_name = at.class.name
|
100
|
-
|
95
|
+
def self.parse_output(output, class_name)
|
101
96
|
case class_name
|
102
97
|
when 'Autotest', 'Autotest::Rails'
|
103
98
|
results = output.scan(/(\d+)\s*failures?,\s*(\d+)\s*errors?/).first
|
104
99
|
num_failures, num_errors = results.map{|r| r.to_i}
|
105
100
|
|
106
101
|
if num_failures > 0 || num_errors > 0
|
107
|
-
|
102
|
+
result = {:message => "Red F:#{num_failures} E:#{num_errors}", :color => :red}
|
108
103
|
else
|
109
|
-
|
104
|
+
result = {:message => 'All Green', :color => :green}
|
110
105
|
end
|
111
106
|
when 'Autotest::Rspec', 'Autotest::Rspec2', 'Autotest::RailsRspec', 'Autotest::RailsRspec2', 'Autotest::MerbRspec'
|
112
107
|
results = output.scan(/(\d+)\s*examples?,\s*(\d+)\s*failures?(?:,\s*(\d+)\s*pendings?)?/).first
|
113
108
|
num_examples, num_failures, num_pendings = results.map{|r| r.to_i}
|
114
109
|
|
115
110
|
if num_failures > 0
|
116
|
-
|
111
|
+
result = {:message => "Fail F:#{num_failures} P:#{num_pendings}", :color => :red}
|
117
112
|
elsif num_pendings > 0
|
118
|
-
|
113
|
+
result = {:message => "Pend F:#{num_failures} P:#{num_pendings}", :color => :yellow}
|
119
114
|
else
|
120
|
-
|
115
|
+
result = {:message => 'All Green', :color => :green}
|
121
116
|
end
|
122
|
-
else
|
123
|
-
@last_result = {:message => "Unknown class. (#{class_name})"}
|
124
117
|
end
|
118
|
+
result || {:message => "Unknown class. (#{class_name})"}
|
119
|
+
end
|
120
|
+
|
121
|
+
Autotest.add_hook :ran_command do |at, *args|
|
122
|
+
next false unless execute?
|
123
|
+
|
124
|
+
output = at.results.join
|
125
|
+
class_name = at.class.name
|
126
|
+
|
127
|
+
@last_result = parse_output(output, class_name)
|
125
128
|
next false
|
126
129
|
end
|
127
130
|
|
data/spec/autotest-tmux_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe Autotest::Tmux do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'When display message' do
|
12
|
-
context 'without
|
12
|
+
context 'without arguments' do
|
13
13
|
it { Autotest::Tmux.message.should be_true }
|
14
14
|
end
|
15
15
|
|
@@ -30,6 +30,64 @@ describe Autotest::Tmux do
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
describe 'When parse result' do
|
34
|
+
%w!Autotest Autotest::Rails!.each do |name|
|
35
|
+
#TODO: Fill out.
|
36
|
+
end
|
37
|
+
|
38
|
+
%w!Autotest::Rspec Autotest::Rspec2 Autotest::RailsRspec Autotest::RailsRspec2 Autotest::MerbRspec!.each do |name|
|
39
|
+
context "With #{name}, 2 of 3 examples feiled" do
|
40
|
+
subject { Autotest::Tmux.parse_output('3 examples, 2 failures', name) }
|
41
|
+
it { should eql({:message => 'Fail F:2 P:0', :color => :red}) }
|
42
|
+
end
|
43
|
+
|
44
|
+
context "With #{name}, 1 of 2 examples feiled" do
|
45
|
+
subject { Autotest::Tmux.parse_output('2 examples, 1 failure', name) }
|
46
|
+
it { should eql({:message => 'Fail F:1 P:0', :color => :red}) }
|
47
|
+
end
|
48
|
+
|
49
|
+
context "With #{name}, 1 of 1 example feiled" do
|
50
|
+
subject { Autotest::Tmux.parse_output('1 example, 1 failure', name) }
|
51
|
+
it { should eql({:message => 'Fail F:1 P:0', :color => :red}) }
|
52
|
+
end
|
53
|
+
|
54
|
+
context "With #{name}, 2 of 3 examples pending and 1 failed" do
|
55
|
+
subject { Autotest::Tmux.parse_output('3 examples, 1 failure, 2 pendings', name) }
|
56
|
+
it { should eql({:message => 'Fail F:1 P:2', :color => :red}) }
|
57
|
+
end
|
58
|
+
|
59
|
+
context "With #{name}, 1 of 2 examples pending and 1 failed" do
|
60
|
+
subject { Autotest::Tmux.parse_output('2 examples, 1 failure, 1 pending', name) }
|
61
|
+
it { should eql({:message => 'Fail F:1 P:1', :color => :red}) }
|
62
|
+
end
|
63
|
+
|
64
|
+
context "With #{name}, 2 of 3 examples pending" do
|
65
|
+
subject { Autotest::Tmux.parse_output('3 examples, 0 failures, 2 pendings', name) }
|
66
|
+
it { should eql({:message => 'Pend F:0 P:2', :color => :yellow}) }
|
67
|
+
end
|
68
|
+
|
69
|
+
context "With #{name}, 1 of 2 examples pending" do
|
70
|
+
subject { Autotest::Tmux.parse_output('2 examples, 0 failures, 1 pending', name) }
|
71
|
+
it { should eql({:message => 'Pend F:0 P:1', :color => :yellow}) }
|
72
|
+
end
|
73
|
+
|
74
|
+
context "With #{name}, all examples passed" do
|
75
|
+
subject { Autotest::Tmux.parse_output('2 examples, 0 failures', name) }
|
76
|
+
it { should eql({:message => 'All Green', :color => :green}) }
|
77
|
+
end
|
78
|
+
|
79
|
+
context "With #{name}, all examples passed" do
|
80
|
+
subject { Autotest::Tmux.parse_output('1 example, 0 failures', name) }
|
81
|
+
it { should eql({:message => 'All Green', :color => :green}) }
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'With FooBar' do
|
86
|
+
subject { Autotest::Tmux.parse_output('1 example, 0 failures', 'FooBar') }
|
87
|
+
it { should eql({:message => 'Unknown class. (FooBar)'}) }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
33
91
|
after(:all) do
|
34
92
|
Autotest::Tmux.clear
|
35
93
|
end
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autotest-tmux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 2
|
8
|
-
- 0
|
9
|
-
version: 1.2.0
|
4
|
+
prerelease:
|
5
|
+
version: 1.2.2
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- MIKAMI Yoshiyuki
|
@@ -14,8 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date:
|
18
|
-
default_executable:
|
13
|
+
date: 2011-07-12 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: autotest
|
@@ -25,10 +20,6 @@ dependencies:
|
|
25
20
|
requirements:
|
26
21
|
- - ">="
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 4
|
30
|
-
- 4
|
31
|
-
- 1
|
32
23
|
version: 4.4.1
|
33
24
|
type: :development
|
34
25
|
version_requirements: *id001
|
@@ -40,10 +31,6 @@ dependencies:
|
|
40
31
|
requirements:
|
41
32
|
- - ">="
|
42
33
|
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 2
|
45
|
-
- 0
|
46
|
-
- 0
|
47
34
|
version: 2.0.0
|
48
35
|
type: :development
|
49
36
|
version_requirements: *id002
|
@@ -55,8 +42,6 @@ dependencies:
|
|
55
42
|
requirements:
|
56
43
|
- - ">="
|
57
44
|
- !ruby/object:Gem::Version
|
58
|
-
segments:
|
59
|
-
- 0
|
60
45
|
version: "0"
|
61
46
|
type: :runtime
|
62
47
|
version_requirements: *id003
|
@@ -71,7 +56,6 @@ extra_rdoc_files:
|
|
71
56
|
- README.rdoc
|
72
57
|
files:
|
73
58
|
- .document
|
74
|
-
- .gitignore
|
75
59
|
- LICENSE
|
76
60
|
- README.rdoc
|
77
61
|
- Rakefile
|
@@ -81,13 +65,12 @@ files:
|
|
81
65
|
- lib/autotest/tmux.rb
|
82
66
|
- spec/autotest-tmux_spec.rb
|
83
67
|
- spec/spec_helper.rb
|
84
|
-
has_rdoc: true
|
85
68
|
homepage: http://github.com/yoshuki/autotest-tmux
|
86
69
|
licenses: []
|
87
70
|
|
88
71
|
post_install_message:
|
89
|
-
rdoc_options:
|
90
|
-
|
72
|
+
rdoc_options: []
|
73
|
+
|
91
74
|
require_paths:
|
92
75
|
- lib
|
93
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -95,24 +78,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
78
|
requirements:
|
96
79
|
- - ">="
|
97
80
|
- !ruby/object:Gem::Version
|
98
|
-
segments:
|
99
|
-
- 0
|
100
81
|
version: "0"
|
101
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
83
|
none: false
|
103
84
|
requirements:
|
104
85
|
- - ">="
|
105
86
|
- !ruby/object:Gem::Version
|
106
|
-
segments:
|
107
|
-
- 0
|
108
87
|
version: "0"
|
109
88
|
requirements: []
|
110
89
|
|
111
90
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.
|
91
|
+
rubygems_version: 1.7.2
|
113
92
|
signing_key:
|
114
93
|
specification_version: 3
|
115
94
|
summary: displays autotest/autospec progress on tmux status-right.
|
116
|
-
test_files:
|
117
|
-
|
118
|
-
- spec/spec_helper.rb
|
95
|
+
test_files: []
|
96
|
+
|