corn 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/lib/corn.rb +6 -1
- data/lib/corn/mini_test.rb +33 -0
- data/lib/corn/test_unit.rb +0 -34
- metadata +38 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3a82b67eb382e2810dda0bd5e2d8f955ada28123
|
4
|
+
data.tar.gz: 8c79cf44380b9eddd0b7a8934fd153d02a1adfa2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eee831ca36dd9e86a33197c89221fad3820a15306f9b704bf6cc2e92fd4d3e54da811c69ae2244da3cf5035cf1fa3115a20ec536dddf2bc5cf9dacc5aac59730
|
7
|
+
data.tar.gz: 1a8c3453a1fa7a56936b71a0495d34eb61b5de156053f09da298f7ff70eaa02ea90ad2ba47eae5ed886f32c730fb14d6f58f1cbe58c21b60e86f255bcdafb84e
|
data/lib/corn.rb
CHANGED
@@ -4,6 +4,7 @@ require 'logger'
|
|
4
4
|
|
5
5
|
require 'corn/report'
|
6
6
|
require 'corn/test_unit'
|
7
|
+
require 'corn/mini_test'
|
7
8
|
|
8
9
|
module Corn
|
9
10
|
module_function
|
@@ -25,7 +26,11 @@ module Corn
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def setup
|
28
|
-
|
29
|
+
if RUBY_VERSION =~ /^1.8/
|
30
|
+
Test::Unit::TestCase.send(:include, TestUnit18)
|
31
|
+
else
|
32
|
+
MiniTest::Unit::TestCase.send(:include, MiniTest)
|
33
|
+
end
|
29
34
|
end
|
30
35
|
|
31
36
|
def report(test_name, &block)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Corn
|
2
|
+
module MiniTest
|
3
|
+
def self.included(base)
|
4
|
+
base.send(:alias_method, :run_without_corn, :run)
|
5
|
+
base.send(:alias_method, :run, :run_with_corn)
|
6
|
+
end
|
7
|
+
|
8
|
+
def run_with_corn(runner, &block)
|
9
|
+
Corn.report("#{__name__}(#{self.class.name})") do |report|
|
10
|
+
@__corn_report__ = report
|
11
|
+
run_without_corn(runner, &block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def before_setup
|
16
|
+
@__corn_report__.record_start(:setup)
|
17
|
+
end
|
18
|
+
|
19
|
+
def after_setup
|
20
|
+
@__corn_report__.record_end
|
21
|
+
@__corn_report__.record_start(__name__)
|
22
|
+
end
|
23
|
+
|
24
|
+
def before_teardown
|
25
|
+
@__corn_report__.record_end
|
26
|
+
@__corn_report__.record_start(:teardown)
|
27
|
+
end
|
28
|
+
|
29
|
+
def after_teardown
|
30
|
+
@__corn_report__.record_end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/corn/test_unit.rb
CHANGED
@@ -38,38 +38,4 @@ module Corn
|
|
38
38
|
yield(Test::Unit::TestCase::FINISHED, name)
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
42
|
-
module TestUnit19
|
43
|
-
def self.included(base)
|
44
|
-
base.send(:alias_method, :run_without_corn, :run)
|
45
|
-
base.send(:alias_method, :run, :run_with_corn)
|
46
|
-
end
|
47
|
-
|
48
|
-
def run_with_corn(runner, &block)
|
49
|
-
Corn.report("#{__name__}(#{self.class.name})") do |report|
|
50
|
-
@__corn_report__ = report
|
51
|
-
run_without_corn(runner, &block)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def before_setup
|
56
|
-
@__corn_report__.record_start(:setup)
|
57
|
-
end
|
58
|
-
|
59
|
-
def after_setup
|
60
|
-
@__corn_report__.record_end
|
61
|
-
@__corn_report__.record_start(__name__)
|
62
|
-
end
|
63
|
-
|
64
|
-
def before_teardown
|
65
|
-
@__corn_report__.record_end
|
66
|
-
@__corn_report__.record_start(:teardown)
|
67
|
-
end
|
68
|
-
|
69
|
-
def after_teardown
|
70
|
-
@__corn_report__.record_end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
TestUnit = RUBY_VERSION =~ /^1.8/ ? TestUnit18 : TestUnit19
|
75
41
|
end
|
metadata
CHANGED
@@ -1,49 +1,58 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: corn
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
- Xiao Li
|
6
|
+
authors:
|
7
|
+
- Xiao Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
11
|
+
|
12
|
+
date: 2014-01-29 00:00:00 Z
|
12
13
|
dependencies: []
|
14
|
+
|
13
15
|
description: TBD
|
14
|
-
email:
|
15
|
-
- swing1979@gmail.com
|
16
|
+
email:
|
17
|
+
- swing1979@gmail.com
|
16
18
|
executables: []
|
19
|
+
|
17
20
|
extensions: []
|
21
|
+
|
18
22
|
extra_rdoc_files: []
|
19
|
-
|
20
|
-
|
21
|
-
-
|
22
|
-
- lib/corn
|
23
|
-
- lib/corn/
|
24
|
-
- lib/corn/
|
23
|
+
|
24
|
+
files:
|
25
|
+
- README.md
|
26
|
+
- lib/corn.rb
|
27
|
+
- lib/corn/mini_test.rb
|
28
|
+
- lib/corn/report.rb
|
29
|
+
- lib/corn/setup.rb
|
30
|
+
- lib/corn/test_unit.rb
|
25
31
|
homepage: https://github.com/xli/corn
|
26
|
-
licenses:
|
27
|
-
- MIT
|
32
|
+
licenses:
|
33
|
+
- MIT
|
28
34
|
metadata: {}
|
35
|
+
|
29
36
|
post_install_message:
|
30
37
|
rdoc_options: []
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- &id001
|
44
|
+
- ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- *id001
|
43
50
|
requirements: []
|
51
|
+
|
44
52
|
rubyforge_project:
|
45
|
-
rubygems_version: 2.
|
53
|
+
rubygems_version: 2.1.9
|
46
54
|
signing_key:
|
47
55
|
specification_version: 4
|
48
56
|
summary: TBD
|
49
57
|
test_files: []
|
58
|
+
|