lemon 0.8.5 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{lemon.gemspec → .gemspec} +0 -0
- data/.ruby +4 -11
- data/Assembly +5 -11
- data/HISTORY.rdoc +31 -0
- data/MANIFEST +45 -55
- data/PROFILE +6 -6
- data/README.md +113 -0
- data/Rakefile +12 -3
- data/VERSION +1 -1
- data/bin/lemonade +8 -0
- data/lib/lemon.rb +52 -2
- data/lib/lemon.yml +4 -11
- data/lib/lemon/{model/ae.rb → ae.rb} +0 -0
- data/lib/lemon/cli.rb +28 -279
- data/lib/lemon/cli/base.rb +139 -0
- data/lib/lemon/cli/coverage.rb +52 -0
- data/lib/lemon/cli/generate.rb +51 -0
- data/lib/lemon/cli/test.rb +50 -0
- data/lib/lemon/core_ext.rb +7 -0
- data/lib/lemon/core_ext/kernel.rb +20 -0
- data/lib/lemon/core_ext/omission.rb +18 -0
- data/lib/lemon/{controller/coverage_analyzer.rb → coverage/analyzer.rb} +41 -19
- data/lib/lemon/{model → coverage}/cover_unit.rb +0 -0
- data/lib/lemon/{view/cover_reports → coverage/formats}/abstract.rb +0 -0
- data/lib/lemon/{view/cover_reports → coverage/formats}/compact.rb +1 -1
- data/lib/lemon/{view/cover_reports → coverage/formats}/outline.rb +1 -1
- data/lib/lemon/{view/cover_reports → coverage/formats}/verbose.rb +1 -1
- data/lib/lemon/{view/cover_reports → coverage/formats}/yaml.rb +1 -1
- data/lib/lemon/{model → coverage}/snapshot.rb +0 -0
- data/lib/lemon/{model → coverage}/source_parser.rb +0 -0
- data/lib/lemon/{controller/scaffold_generator.rb → generator.rb} +53 -14
- data/lib/lemon/test_advice.rb +63 -0
- data/lib/lemon/test_case.rb +270 -0
- data/lib/lemon/test_class.rb +28 -0
- data/lib/lemon/test_method.rb +207 -0
- data/lib/lemon/test_module.rb +114 -0
- data/lib/lemon/test_proc.rb +140 -0
- data/lib/lemon/test_setup.rb +54 -0
- data/lib/lemon/test_world.rb +9 -0
- data/notes/{2010-05-06-files_not_classes.rdoc → 2010-05-06-files-not-classes.rdoc} +0 -0
- data/notes/{2010-07-11-acid_testing.rdoc → 2010-07-11-acid-testing.rdoc} +0 -0
- data/notes/2011-07-07-nailing-down-the-nomenclature.md +6 -0
- data/site/index.html +7 -6
- data/{qed → spec}/applique/fs.rb +0 -0
- data/{qed → spec}/coverage/01_complete.rdoc +26 -16
- data/{qed → spec}/coverage/02_incomplete.rdoc +10 -7
- data/{qed → spec}/coverage/03_extensions.rdoc +10 -6
- data/spec/coverage/applique/lemon.rb +1 -0
- data/try/.test +8 -0
- data/try/case_error.rb +18 -0
- data/try/case_fail.rb +19 -0
- data/try/case_pass.rb +42 -0
- data/try/case_pending.rb +18 -0
- data/try/case_singleton.rb +18 -0
- data/try/case_untested.rb +14 -0
- data/try/fixtures/calculator.rb +15 -0
- data/{demo/fixture → try/fixtures}/example-use.rb +0 -0
- data/{demo/fixture → try/fixtures}/example.rb +0 -0
- data/try/helpers/loadpath.rb +1 -0
- data/{.config → work/deprecated}/cucumber.yml +0 -0
- data/{features → work/deprecated/features}/coverage.feature +0 -0
- data/{features → work/deprecated/features}/generate.feature +0 -0
- data/{features → work/deprecated/features}/step_definitions/coverage_steps.rb +0 -0
- data/{features → work/deprecated/features}/support/ae.rb +0 -0
- data/{features → work/deprecated/features}/support/aruba.rb +0 -0
- data/{features → work/deprecated/features}/test.feature +0 -0
- data/work/deprecated/model/dsl/advice.rb +78 -0
- data/work/deprecated/model/dsl/subject.rb +40 -0
- data/{lib/lemon → work/deprecated}/model/main.rb +40 -29
- data/work/deprecated/model/test.rb +54 -0
- data/work/deprecated/model/test_base_dsl.rb +88 -0
- data/work/deprecated/model/test_clause.rb +112 -0
- data/{lib/lemon → work/deprecated}/model/test_context.rb +24 -24
- data/work/deprecated/model/test_feature.rb +128 -0
- data/work/deprecated/model/test_scenario.rb +137 -0
- data/{lib/lemon → work/deprecated}/model/test_suite.rb +113 -32
- data/work/deprecated/rake.rb +103 -0
- data/{test → work/deprecated/test}/case_coverage_analyzer.rb +0 -0
- data/{test → work/deprecated/test}/case_test_case_dsl.rb +2 -2
- data/{test → work/deprecated/test}/fixtures/case_complete.rb +0 -0
- data/{test → work/deprecated/test}/fixtures/case_inclusion.rb +0 -0
- data/{test → work/deprecated/test}/fixtures/case_incomplete.rb +0 -0
- data/{test → work/deprecated/test}/fixtures/example.rb +0 -0
- data/{test → work/deprecated/test}/fixtures/helper.rb +0 -0
- data/{test → work/deprecated/test}/runner +0 -0
- data/work/old-tests/case_example.rb +15 -0
- data/work/old-tests/feature_example.rb +40 -0
- data/work/reference/dsl2.rb +4 -0
- metadata +101 -98
- data/README.rdoc +0 -103
- data/bin/lemon +0 -4
- data/demo/case_example_error.rb +0 -10
- data/demo/case_example_fail.rb +0 -15
- data/demo/case_example_pass.rb +0 -32
- data/demo/case_example_pending.rb +0 -14
- data/demo/case_example_untested.rb +0 -10
- data/lib/lemon/controller/test_runner.rb +0 -299
- data/lib/lemon/model/pending.rb +0 -10
- data/lib/lemon/model/test_case.rb +0 -305
- data/lib/lemon/model/test_unit.rb +0 -147
- data/lib/lemon/view/test_reports/abstract.rb +0 -256
- data/lib/lemon/view/test_reports/dotprogress.rb +0 -73
- data/lib/lemon/view/test_reports/html.rb +0 -146
- data/lib/lemon/view/test_reports/outline.rb +0 -118
- data/lib/lemon/view/test_reports/summary.rb +0 -131
- data/lib/lemon/view/test_reports/tap.rb +0 -49
- data/lib/lemon/view/test_reports/tapj.rb +0 -130
- data/lib/lemon/view/test_reports/tapy.rb +0 -141
- data/lib/lemon/view/test_reports/verbose.rb +0 -197
- data/work/sandbox/lib/sample.rb +0 -13
- data/work/sandbox/test/sample_case.rb +0 -12
- data/work/trash/example-cover.rb +0 -5
- data/work/trash/example.rb +0 -16
@@ -1,197 +0,0 @@
|
|
1
|
-
require 'lemon/view/test_reports/abstract'
|
2
|
-
|
3
|
-
module Lemon::TestReports
|
4
|
-
|
5
|
-
# Timed Reporter
|
6
|
-
class Verbose < Abstract
|
7
|
-
|
8
|
-
LAYOUT = " %-12s %11s %11s %s %s"
|
9
|
-
|
10
|
-
#
|
11
|
-
def start_suite(suite)
|
12
|
-
@start = Time.now
|
13
|
-
timer_reset
|
14
|
-
end
|
15
|
-
|
16
|
-
#
|
17
|
-
def start_case(tc)
|
18
|
-
if @_last == :unit
|
19
|
-
puts
|
20
|
-
@_last = :case
|
21
|
-
end
|
22
|
-
puts tc.to_s.ansi(:bold)
|
23
|
-
puts
|
24
|
-
end
|
25
|
-
|
26
|
-
#
|
27
|
-
def context(context)
|
28
|
-
unless context.to_s.empty?
|
29
|
-
if @_last == :unit
|
30
|
-
puts
|
31
|
-
@_last = :context
|
32
|
-
end
|
33
|
-
puts " #{context}"
|
34
|
-
puts
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
#
|
39
|
-
def start_unit(unit)
|
40
|
-
if @context != unit.context
|
41
|
-
@context = unit.context
|
42
|
-
context(@context)
|
43
|
-
end
|
44
|
-
timer_reset
|
45
|
-
end
|
46
|
-
|
47
|
-
#
|
48
|
-
def omit(unit)
|
49
|
-
data = ["OMIT".ansi(:cyan), timer, clock, unit.name.ansi(:bold), unit.aspect]
|
50
|
-
puts LAYOUT % data
|
51
|
-
#puts " %s %s %s" % [" OMIT".ansi(:cyan), unit.to_s, unit.aspect]
|
52
|
-
@_last = :unit
|
53
|
-
end
|
54
|
-
|
55
|
-
#
|
56
|
-
def pass(unit)
|
57
|
-
data = ["PASS".ansi(:green), timer, clock, unit.name.ansi(:bold), unit.aspect]
|
58
|
-
puts LAYOUT % data
|
59
|
-
end
|
60
|
-
|
61
|
-
#
|
62
|
-
def fail(unit, exception)
|
63
|
-
data = ["FAIL".ansi(:red), timer, clock, unit.name.ansi(:bold), unit.aspect]
|
64
|
-
puts LAYOUT % data
|
65
|
-
#puts
|
66
|
-
#puts " FAIL #{exception.backtrace[0]}"
|
67
|
-
#puts " #{exception}"
|
68
|
-
#puts
|
69
|
-
end
|
70
|
-
|
71
|
-
#
|
72
|
-
def error(unit, exception)
|
73
|
-
data = ["ERRS".ansi(:red, :bold), timer, clock, unit.name.ansi(:bold), unit.aspect]
|
74
|
-
puts LAYOUT % data
|
75
|
-
#puts
|
76
|
-
#puts " ERROR #{exception.class}"
|
77
|
-
#puts " #{exception}"
|
78
|
-
#puts " " + exception.backtrace.join("\n ")
|
79
|
-
#puts
|
80
|
-
end
|
81
|
-
|
82
|
-
#
|
83
|
-
def pending(unit, exception)
|
84
|
-
data = ["PEND".ansi(:yellow), timer, clock, unit.name.ansi(:bold), unit.aspect]
|
85
|
-
puts LAYOUT % data
|
86
|
-
end
|
87
|
-
|
88
|
-
#
|
89
|
-
def finish_unit(unit)
|
90
|
-
@_last = :unit
|
91
|
-
end
|
92
|
-
|
93
|
-
#
|
94
|
-
def finish_suite(suite)
|
95
|
-
puts
|
96
|
-
|
97
|
-
unless record[:omit].empty?
|
98
|
-
puts "OMITTED:\n\n"
|
99
|
-
puts record[:omit].map{ |u| u.to_s }.sort.join(' ')
|
100
|
-
puts
|
101
|
-
end
|
102
|
-
|
103
|
-
unless record[:pending].empty?
|
104
|
-
puts "PENDING:\n\n"
|
105
|
-
record[:pending].each do |unit, exception|
|
106
|
-
puts " #{unit}"
|
107
|
-
puts " #{file_and_line(exception)}"
|
108
|
-
puts
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
unless record[:fail].empty?
|
113
|
-
puts "FAILURES:\n\n"
|
114
|
-
record[:fail].each do |unit, exception|
|
115
|
-
puts " #{unit}"
|
116
|
-
puts " #{file_and_line(exception)}"
|
117
|
-
puts " #{exception}"
|
118
|
-
puts code_snippet(exception)
|
119
|
-
#puts " #{exception.backtrace[0]}"
|
120
|
-
puts
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
unless record[:error].empty?
|
125
|
-
puts "ERRORS:\n\n"
|
126
|
-
record[:error].each do |unit, exception|
|
127
|
-
puts " #{unit}".ansi(:bold)
|
128
|
-
puts " #{exception.class} @ #{file_and_line(exception)}"
|
129
|
-
puts " #{exception}"
|
130
|
-
puts code_snippet(exception)
|
131
|
-
#puts " #{exception.backtrace[0]}"
|
132
|
-
puts
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
puts tally
|
137
|
-
end
|
138
|
-
|
139
|
-
#
|
140
|
-
def clock
|
141
|
-
secs = Time.now - @start
|
142
|
-
return "%0.5fs" % [secs.to_s]
|
143
|
-
end
|
144
|
-
|
145
|
-
#
|
146
|
-
def timer
|
147
|
-
secs = Time.now - @time
|
148
|
-
@time = Time.now
|
149
|
-
return "%0.5fs" % [secs.to_s]
|
150
|
-
end
|
151
|
-
|
152
|
-
#
|
153
|
-
def timer_reset
|
154
|
-
@time = Time.now
|
155
|
-
end
|
156
|
-
|
157
|
-
end
|
158
|
-
|
159
|
-
end
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
=begin
|
165
|
-
if cover?
|
166
|
-
|
167
|
-
unless uncovered_cases.empty?
|
168
|
-
unc = uncovered_cases.map do |mod|
|
169
|
-
yellow(mod.name)
|
170
|
-
end.join(", ")
|
171
|
-
puts "\nUncovered Cases: " + unc
|
172
|
-
end
|
173
|
-
|
174
|
-
unless uncovered_units.empty?
|
175
|
-
unc = uncovered_units.map do |unit|
|
176
|
-
yellow(unit)
|
177
|
-
end.join(", ")
|
178
|
-
puts "\nUncovered Units: " + unc
|
179
|
-
end
|
180
|
-
|
181
|
-
#unless uncovered.empty?
|
182
|
-
# unc = uncovered.map do |unit|
|
183
|
-
# yellow(unit)
|
184
|
-
# end.join(", ")
|
185
|
-
# puts "\nUncovered: " + unc
|
186
|
-
#end
|
187
|
-
|
188
|
-
unless undefined_units.empty?
|
189
|
-
unc = undefined_units.map do |unit|
|
190
|
-
yellow(unit)
|
191
|
-
end.join(", ")
|
192
|
-
puts "\nUndefined Units: " + unc
|
193
|
-
end
|
194
|
-
|
195
|
-
end
|
196
|
-
=end
|
197
|
-
|
data/work/sandbox/lib/sample.rb
DELETED
data/work/trash/example-cover.rb
DELETED