lemon 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +55 -0
- data/APACHE2.txt +206 -0
- data/HISTORY.rdoc +12 -0
- data/NOTICE.rdoc +16 -0
- data/bin/lemon +1 -1
- data/demo/case_example_error.rb +10 -0
- data/{test/cli → features}/coverage.feature +0 -0
- data/{test/cli → features}/generate.feature +0 -0
- data/{test/cli → features}/step_definitions/coverage_steps.rb +0 -0
- data/{test/cli → features}/support/ae.rb +0 -0
- data/{test/cli → features}/support/aruba.rb +0 -0
- data/{test/cli → features}/test.feature +0 -0
- data/lib/lemon.rb +19 -1
- data/lib/lemon.yml +55 -0
- data/lib/lemon/cli.rb +0 -1
- data/lib/lemon/controller/test_runner.rb +12 -3
- data/lib/lemon/model/test_case.rb +4 -2
- data/lib/lemon/model/test_unit.rb +45 -2
- data/lib/lemon/view/test_reports/abstract.rb +107 -0
- data/lib/lemon/view/test_reports/tapj.rb +130 -0
- data/lib/lemon/view/test_reports/tapy.rb +141 -0
- data/qed/applique/fs.rb +21 -0
- data/{test/api/coverage/complete.rdoc → qed/coverage/01_complete.rdoc} +9 -9
- data/qed/coverage/02_incomplete.rdoc +97 -0
- data/{test/api/coverage/extensions.rdoc → qed/coverage/03_extensions.rdoc} +5 -5
- data/test/{unit/case_coverage_analyzer.rb → case_coverage_analyzer.rb} +0 -0
- data/test/{unit/case_test_case_dsl.rb → case_test_case_dsl.rb} +0 -0
- data/test/fixtures/case_complete.rb +5 -1
- data/test/runner +1 -2
- metadata +31 -39
- data/LICENSE +0 -22
- data/lib/lemon/meta/data.rb +0 -29
- data/lib/lemon/meta/gemfile +0 -24
- data/lib/lemon/meta/profile +0 -17
- data/meta/data.rb +0 -29
- data/meta/gemfile +0 -24
- data/meta/profile +0 -17
- data/test/api/applique/fs.rb +0 -18
- data/test/api/coverage/incomplete.rdoc +0 -97
data/lib/lemon/meta/gemfile
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name : lemon
|
3
|
-
version : 0.8.2
|
4
|
-
date : 2010-09-05
|
5
|
-
|
6
|
-
requires:
|
7
|
-
- name: ae
|
8
|
-
group: runtime
|
9
|
-
|
10
|
-
- name: syckle
|
11
|
-
group: development
|
12
|
-
|
13
|
-
- name: box
|
14
|
-
group: development
|
15
|
-
|
16
|
-
- name: cucumber
|
17
|
-
group: test
|
18
|
-
|
19
|
-
- name: ae
|
20
|
-
group: test
|
21
|
-
|
22
|
-
- name: aruba
|
23
|
-
group: test
|
24
|
-
|
data/lib/lemon/meta/profile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title : Lemon
|
3
|
-
suite : proutils
|
4
|
-
summary: Pucker-tight Unit Testing
|
5
|
-
authors: Thomas Sawyer
|
6
|
-
contact: trans <transfire@gmail.com>
|
7
|
-
license: Apache 2.0
|
8
|
-
|
9
|
-
description:
|
10
|
-
Lemon is a unit testing framework that tightly correlates
|
11
|
-
class to test case and method to test unit.
|
12
|
-
|
13
|
-
resources:
|
14
|
-
homepage: http://proutils.github.com/lemon
|
15
|
-
repository: git://github.com/proutils/lemon.git
|
16
|
-
|
17
|
-
copyright: Copyright 2009 Thomas Sawyer
|
data/meta/data.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
Object.__send__(:remove_const, :VERSION) if Object.const_defined?(:VERSION) # becuase Ruby 1.8~ gets in the way
|
2
|
-
|
3
|
-
module Lemon
|
4
|
-
|
5
|
-
def self.__DIR__
|
6
|
-
File.dirname(__FILE__)
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.gemfile
|
10
|
-
@gemfile ||= (
|
11
|
-
require 'yaml'
|
12
|
-
YAML.load(File.new(__DIR__ + '/gemfile'))
|
13
|
-
)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.profile
|
17
|
-
@profile ||= (
|
18
|
-
require 'yaml'
|
19
|
-
YAML.load(File.new(__DIR__ + '/profile'))
|
20
|
-
)
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.const_missing(name)
|
24
|
-
key = name.to_s.downcase
|
25
|
-
gemfile[key] || profile[key] || super(name)
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
data/meta/gemfile
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name : lemon
|
3
|
-
version : 0.8.2
|
4
|
-
date : 2010-09-05
|
5
|
-
|
6
|
-
requires:
|
7
|
-
- name: ae
|
8
|
-
group: runtime
|
9
|
-
|
10
|
-
- name: syckle
|
11
|
-
group: development
|
12
|
-
|
13
|
-
- name: box
|
14
|
-
group: development
|
15
|
-
|
16
|
-
- name: cucumber
|
17
|
-
group: test
|
18
|
-
|
19
|
-
- name: ae
|
20
|
-
group: test
|
21
|
-
|
22
|
-
- name: aruba
|
23
|
-
group: test
|
24
|
-
|
data/meta/profile
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title : Lemon
|
3
|
-
suite : proutils
|
4
|
-
summary: Pucker-tight Unit Testing
|
5
|
-
authors: Thomas Sawyer
|
6
|
-
contact: trans <transfire@gmail.com>
|
7
|
-
license: Apache 2.0
|
8
|
-
|
9
|
-
description:
|
10
|
-
Lemon is a unit testing framework that tightly correlates
|
11
|
-
class to test case and method to test unit.
|
12
|
-
|
13
|
-
resources:
|
14
|
-
homepage: http://proutils.github.com/lemon
|
15
|
-
repository: git://github.com/proutils/lemon.git
|
16
|
-
|
17
|
-
copyright: Copyright 2009 Thomas Sawyer
|
data/test/api/applique/fs.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
|
3
|
-
Before :demo do
|
4
|
-
FileUtils.rm_r('tmp')
|
5
|
-
end
|
6
|
-
|
7
|
-
When "Given an example script in '(((.*?)))' as follows" do |name, text|
|
8
|
-
name = File.join('tmp', name) if /^tmp/ !~ name
|
9
|
-
FileUtils.mkdir_p(File.dirname(name))
|
10
|
-
File.open(name, 'w'){ |w| w << text }
|
11
|
-
end
|
12
|
-
|
13
|
-
When "given a test case in '(((.*?)))' as follows" do |name, text|
|
14
|
-
name = File.join('tmp', name) if /^tmp/ !~ name
|
15
|
-
FileUtils.mkdir_p(File.dirname(name))
|
16
|
-
File.open(name, 'w'){ |w| w << text }
|
17
|
-
end
|
18
|
-
|
@@ -1,97 +0,0 @@
|
|
1
|
-
== Incomplete Coverage
|
2
|
-
|
3
|
-
=== Incomplete Coverage of Public Interface
|
4
|
-
|
5
|
-
Given an example script in 'tmp/lib/example.rb' as follows:
|
6
|
-
|
7
|
-
class C1
|
8
|
-
def f1; "f1"; end
|
9
|
-
def f2; "f2"; end
|
10
|
-
def f3; "f3"; end
|
11
|
-
end
|
12
|
-
|
13
|
-
class C2
|
14
|
-
def g1; "g1"; end
|
15
|
-
protected
|
16
|
-
def g2; "g2"; end
|
17
|
-
private
|
18
|
-
def g3; "g3"; end
|
19
|
-
end
|
20
|
-
|
21
|
-
class C3
|
22
|
-
def h1; "h1"; end
|
23
|
-
end
|
24
|
-
|
25
|
-
And given a test case in 'tmp/test/example_case.rb' as follows:
|
26
|
-
|
27
|
-
covers 'example.rb'
|
28
|
-
|
29
|
-
testcase C1 do
|
30
|
-
unit :f1 => "Returns a String" do
|
31
|
-
end
|
32
|
-
unit :f2 => "Returns a String" do
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
testcase C2 do
|
37
|
-
unit :x1 => "Does not exist" do
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
And we get the coverage information via CoverageAnalyer.
|
42
|
-
|
43
|
-
require 'lemon'
|
44
|
-
|
45
|
-
tests = ['tmp/test/example_case.rb']
|
46
|
-
|
47
|
-
coverage = Lemon::CoverageAnalyzer.new(tests, :loadpath=>'tmp/lib')
|
48
|
-
|
49
|
-
Then we should see that there are 2 unconvered units, C1#f3 and C2#g1
|
50
|
-
because no testcase unit was defined for them and they are both public methods.
|
51
|
-
|
52
|
-
coverage.uncovered_units.size.assert == 2
|
53
|
-
|
54
|
-
units = coverage.uncovered_units.map{ |u| u.to_s }
|
55
|
-
|
56
|
-
units.assert.include?('C1#f3')
|
57
|
-
units.assert.include?('C2#g1')
|
58
|
-
|
59
|
-
You might expect that 'C3#h1' would be in the uncovered units list as well,
|
60
|
-
since it is a public method and no test unit covers it. However, there is
|
61
|
-
no test case for C3 at all, so Lemon takes that to mean that C3 is of
|
62
|
-
no interest.
|
63
|
-
|
64
|
-
units.refute.include?('C3#h1')
|
65
|
-
|
66
|
-
But C3 will be listed in the uncovered cases list.
|
67
|
-
|
68
|
-
coverage.uncovered_cases == [C3]
|
69
|
-
|
70
|
-
Note that uncovered case methods can be included in the uncovered units list
|
71
|
-
by setting the +zealous+ option, which we will demonstrate later.
|
72
|
-
|
73
|
-
There should still be 3 covered units, C1#f1, C1#f2 and C2#x1.
|
74
|
-
|
75
|
-
coverage.covered_units.size.assert == 3
|
76
|
-
|
77
|
-
units = coverage.covered_units.map{ |u| u.to_s }
|
78
|
-
|
79
|
-
units.assert.include?('C1#f1')
|
80
|
-
units.assert.include?('C1#f2')
|
81
|
-
units.assert.include?('C2#x1')
|
82
|
-
|
83
|
-
But we will not find any covered units for class C2.
|
84
|
-
|
85
|
-
units.refute.include?('C2#g1')
|
86
|
-
units.refute.include?('C2#g2')
|
87
|
-
units.refute.include?('C2#g3')
|
88
|
-
|
89
|
-
Notice also that we defined a unit for C2#x1, a method that does not exist.
|
90
|
-
So it should be listed in the undefined units list.
|
91
|
-
|
92
|
-
coverage.undefined_units.size.assert == 1
|
93
|
-
|
94
|
-
units = coverage.undefined_units.map{ |u| u.to_s }
|
95
|
-
|
96
|
-
units.assert.include?('C2#x1')
|
97
|
-
|