corn 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 607a7f0ddaf8c0d778472a489584bae965435d46
4
- data.tar.gz: bbd395af2e6c79c364ac5ed250994a49baedd9d1
5
- SHA512:
6
- metadata.gz: ab8d249138a7a9ae6246e130b9af1f9b1d15366f59114f826aef86f00f755118a617754b5fa721919ef75660179cdd6ab88255a4aa9fad5f7f74d8920ccb3c59
7
- data.tar.gz: 2b375bf3db20fffee3e335f6fde8a841f72f955c8767d2a72f9fb371cca9a32ad08ceaa4ff8d77ffe916013ce6064d9f9c51847dadf9bfed294c81cd0257e518
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3a82b67eb382e2810dda0bd5e2d8f955ada28123
4
+ data.tar.gz: 8c79cf44380b9eddd0b7a8934fd153d02a1adfa2
5
+ SHA512:
6
+ metadata.gz: eee831ca36dd9e86a33197c89221fad3820a15306f9b704bf6cc2e92fd4d3e54da811c69ae2244da3cf5035cf1fa3115a20ec536dddf2bc5cf9dacc5aac59730
7
+ data.tar.gz: 1a8c3453a1fa7a56936b71a0495d34eb61b5de156053f09da298f7ff70eaa02ea90ad2ba47eae5ed886f32c730fb14d6f58f1cbe58c21b60e86f255bcdafb84e
@@ -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
- Test::Unit::TestCase.send(:include, Corn::TestUnit)
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
@@ -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.2
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
- date: 2014-01-29 00:00:00.000000000 Z
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
- files:
20
- - README.md
21
- - lib/corn.rb
22
- - lib/corn/report.rb
23
- - lib/corn/setup.rb
24
- - lib/corn/test_unit.rb
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
- require_paths:
32
- - lib
33
- required_ruby_version: !ruby/object:Gem::Requirement
34
- requirements:
35
- - - ">="
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- required_rubygems_version: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
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.2.0
53
+ rubygems_version: 2.1.9
46
54
  signing_key:
47
55
  specification_version: 4
48
56
  summary: TBD
49
57
  test_files: []
58
+