test_unit_helper 0.0.1 → 0.0.2

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.
@@ -0,0 +1,171 @@
1
+ This version of the GNU Lesser General Public License incorporates
2
+ the terms and conditions of version 3 of the GNU General Public
3
+ License, supplemented by the additional permissions listed below.
4
+
5
+
6
+ 0. Additional Definitions.
7
+ --------------------------
8
+
9
+ As used herein, "this License" refers to version 3 of the GNU Lesser
10
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
11
+ General Public License.
12
+
13
+ "The Library" refers to a covered work governed by this License,
14
+ other than an Application or a Combined Work as defined below.
15
+
16
+ An "Application" is any work that makes use of an interface provided
17
+ by the Library, but which is not otherwise based on the Library.
18
+ Defining a subclass of a class defined by the Library is deemed a mode
19
+ of using an interface provided by the Library.
20
+
21
+ A "Combined Work" is a work produced by combining or linking an
22
+ Application with the Library. The particular version of the Library
23
+ with which the Combined Work was made is also called the "Linked
24
+ Version".
25
+
26
+ The "Minimal Corresponding Source" for a Combined Work means the
27
+ Corresponding Source for the Combined Work, excluding any source code
28
+ for portions of the Combined Work that, considered in isolation, are
29
+ based on the Application, and not on the Linked Version.
30
+
31
+ The "Corresponding Application Code" for a Combined Work means the
32
+ object code and/or source code for the Application, including any data
33
+ and utility programs needed for reproducing the Combined Work from the
34
+ Application, but excluding the System Libraries of the Combined Work.
35
+
36
+
37
+ 1. Exception to Section 3 of the GNU GPL.
38
+ --------------------------------------------------------------------------------
39
+
40
+ You may convey a covered work under sections 3 and 4 of this License
41
+ without being bound by section 3 of the GNU GPL.
42
+
43
+
44
+ 2. Conveying Modified Versions.
45
+ --------------------------------------------------------------------------------
46
+
47
+ If you modify a copy of the Library, and, in your modifications, a
48
+ facility refers to a function or data to be supplied by an Application
49
+ that uses the facility (other than as an argument passed when the
50
+ facility is invoked), then you may convey a copy of the modified
51
+ version:
52
+
53
+ * a) under this License, provided that you make a good faith effort to
54
+ ensure that, in the event an Application does not supply the
55
+ function or data, the facility still operates, and performs
56
+ whatever part of its purpose remains meaningful, or
57
+
58
+ * b) under the GNU GPL, with none of the additional permissions of
59
+ this License applicable to that copy.
60
+
61
+
62
+ 3. Object Code Incorporating Material from Library Header Files.
63
+ --------------------------------------------------------------------------------
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ * a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ * b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+
80
+ 4. Combined Works.
81
+ --------------------------------------------------------------------------------
82
+
83
+ You may convey a Combined Work under terms of your choice that,
84
+ taken together, effectively do not restrict modification of the
85
+ portions of the Library contained in the Combined Work and reverse
86
+ engineering for debugging such modifications, if you also do each of
87
+ the following:
88
+
89
+ * a) Give prominent notice with each copy of the Combined Work that
90
+ the Library is used in it and that the Library and its use are
91
+ covered by this License.
92
+
93
+ * b) Accompany the Combined Work with a copy of the GNU GPL and this license
94
+ document.
95
+
96
+ * c) For a Combined Work that displays copyright notices during
97
+ execution, include the copyright notice for the Library among
98
+ these notices, as well as a reference directing the user to the
99
+ copies of the GNU GPL and this license document.
100
+
101
+ * d) Do one of the following:
102
+
103
+ * 0) Convey the Minimal Corresponding Source under the terms of this
104
+ License, and the Corresponding Application Code in a form
105
+ suitable for, and under terms that permit, the user to
106
+ recombine or relink the Application with a modified version of
107
+ the Linked Version to produce a modified Combined Work, in the
108
+ manner specified by section 6 of the GNU GPL for conveying
109
+ Corresponding Source.
110
+
111
+ * 1) Use a suitable shared library mechanism for linking with the
112
+ Library. A suitable mechanism is one that (a) uses at run time
113
+ a copy of the Library already present on the user's computer
114
+ system, and (b) will operate properly with a modified version
115
+ of the Library that is interface-compatible with the Linked
116
+ Version.
117
+
118
+ * e) Provide Installation Information, but only if you would otherwise
119
+ be required to provide such information under section 6 of the
120
+ GNU GPL, and only to the extent that such information is
121
+ necessary to install and execute a modified version of the
122
+ Combined Work produced by recombining or relinking the
123
+ Application with a modified version of the Linked Version. (If
124
+ you use option 4d0, the Installation Information must accompany
125
+ the Minimal Corresponding Source and Corresponding Application
126
+ Code. If you use option 4d1, you must provide the Installation
127
+ Information in the manner specified by section 6 of the GNU GPL
128
+ for conveying Corresponding Source.)
129
+
130
+
131
+ 5. Combined Libraries.
132
+ --------------------------------------------------------------------------------
133
+
134
+ You may place library facilities that are a work based on the
135
+ Library side by side in a single library together with other library
136
+ facilities that are not Applications and are not covered by this
137
+ License, and convey such a combined library under terms of your
138
+ choice, if you do both of the following:
139
+
140
+ * a) Accompany the combined library with a copy of the same work based
141
+ on the Library, uncombined with any other library facilities,
142
+ conveyed under the terms of this License.
143
+
144
+ * b) Give prominent notice with the combined library that part of it
145
+ is a work based on the Library, and explaining where to find the
146
+ accompanying uncombined form of the same work.
147
+
148
+
149
+ 6. Revised Versions of the GNU Lesser General Public License.
150
+ --------------------------------------------------------------------------------
151
+
152
+ The Free Software Foundation may publish revised and/or new versions
153
+ of the GNU Lesser General Public License from time to time. Such new
154
+ versions will be similar in spirit to the present version, but may
155
+ differ in detail to address new problems or concerns.
156
+
157
+ Each version is given a distinguishing version number. If the
158
+ Library as you received it specifies that a certain numbered version
159
+ of the GNU Lesser General Public License "or any later version"
160
+ applies to it, you have the option of following the terms and
161
+ conditions either of that published version or of any later version
162
+ published by the Free Software Foundation. If the Library as you
163
+ received it does not specify a version number of the GNU Lesser
164
+ General Public License, you may choose any version of the GNU Lesser
165
+ General Public License ever published by the Free Software Foundation.
166
+
167
+ If the Library as you received it specifies that a proxy can decide
168
+ whether future versions of the GNU Lesser General Public License shall
169
+ apply, that proxy's public statement of acceptance of any version is
170
+ permanent authorization for you to choose that version for the
171
+ Library.
File without changes
data/rakefile CHANGED
File without changes
File without changes
File without changes
@@ -0,0 +1,70 @@
1
+ require_relative '../helper.rb'
2
+
3
+ class ClassMethodsTest < Test::Unit::TestCase
4
+ test '.test_class returns the class as a string' do
5
+ assert_equal 'HappyPath', HappyPathTest.test_class
6
+ assert_equal 'HappyPath', TestHappyPath.test_class
7
+ end
8
+
9
+ test '.test_class returns nil if the constant is not found' do
10
+ assert_nil NoClassTest.test_class
11
+ end
12
+
13
+ test '.test_class returns nil given the class name does not start or end with Test' do
14
+ assert_nil NoTestPrefixOrSuffix.test_class
15
+ end
16
+
17
+ test '.test_class returns the class given the class starts with "Tests"' do
18
+ assert_equal 'TestsSomething', TestsSomethingTest.test_class
19
+ end
20
+
21
+ test '.test_class returns the class given the class starts with "Test"' do
22
+ assert_equal 'TestPrefix', TestPrefixTest.test_class
23
+ end
24
+
25
+ test '.test_class returns the class given the class ends with "Test"' do
26
+ assert_equal 'SuffixTest', TestSuffixTest.test_class
27
+ end
28
+ end
29
+
30
+ class HappyPath
31
+ end
32
+
33
+ class HappyPathTest
34
+ extend TestUnitHelper::ClassMethods
35
+ end
36
+
37
+ class TestHappyPath
38
+ extend TestUnitHelper::ClassMethods
39
+ end
40
+
41
+ class NoClassTest
42
+ extend TestUnitHelper::ClassMethods
43
+ end
44
+
45
+ class NoTestPrefixOrSuffix
46
+ extend TestUnitHelper::ClassMethods
47
+ end
48
+
49
+ class TestsSomething
50
+ end
51
+
52
+ class TestsSomethingTest
53
+ extend TestUnitHelper::ClassMethods
54
+ end
55
+
56
+ class TestPrefix
57
+ end
58
+
59
+ class TestPrefixTest
60
+ extend TestUnitHelper::ClassMethods
61
+ end
62
+
63
+ class SuffixTest
64
+ end
65
+
66
+ class TestSuffixTest
67
+ extend TestUnitHelper::ClassMethods
68
+ end
69
+
70
+
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'test_unit_helper'
3
- s.version = '0.0.1'
3
+ s.version = '0.0.2'
4
4
 
5
5
  s.summary = 'Provides additional functionality to Test::Unit'
6
6
  s.description = %Q{
@@ -13,13 +13,13 @@ TestUnitHelper provides additional functionality to Test::Unit.
13
13
 
14
14
  s.license = 'LGPLV3'
15
15
 
16
- s.extra_rdoc_files = ['README', 'license/gplv3', 'license/lgplv3']
16
+ s.extra_rdoc_files = ['README.md', 'license/gplv3.md', 'license/lgplv3.md']
17
17
 
18
18
  s.require_paths = ['lib']
19
19
  s.files = Dir['lib/**/*.rb', 'license/**/*', '*'] - Dir['Gemfile.lock']
20
20
  s.test_files = Dir['test/**/*.rb']
21
21
 
22
- s.add_development_dependency 'rake_tasks', '~> 2.0.5'
22
+ s.add_development_dependency 'rake_tasks', '~> 2.0.6'
23
23
 
24
24
  s.has_rdoc = true
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_unit_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,45 +9,51 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-04 00:00:00.000000000 Z
12
+ date: 2012-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake_tasks
16
- requirement: &14625900 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.0.5
21
+ version: 2.0.6
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *14625900
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.6
25
30
  description: TestUnitHelper provides additional functionality to Test::Unit.
26
31
  email: tthetoad@gmail.com
27
32
  executables: []
28
33
  extensions: []
29
34
  extra_rdoc_files:
30
- - README
31
- - license/gplv3
32
- - license/lgplv3
35
+ - README.md
36
+ - license/gplv3.md
37
+ - license/lgplv3.md
33
38
  files:
34
39
  - lib/test_unit_helper.rb
35
40
  - lib/test_unit_helper/instance_methods.rb
36
- - lib/test_unit_helper/class_methods.rb
37
41
  - lib/test_unit_helper/ext/test/unit/test_case.rb
38
- - license/gplv3
39
- - license/lgplv3
42
+ - lib/test_unit_helper/class_methods.rb
43
+ - license/gplv3.md
44
+ - license/lgplv3.md
40
45
  - license/lgplv3.png
41
- - README
42
- - Gemfile
43
46
  - rakefile
47
+ - Gemfile
44
48
  - test_unit_helper.gemspec
45
- - test/helper.rb
49
+ - README.md
50
+ - test/unit/class_methods_test.rb
46
51
  - test/unit/test_test_case.rb
47
- - test/unit/dumb_test.rb
48
- - test/unit/test_dumb.rb
49
52
  - test/unit/output_test.rb
53
+ - test/unit/test_dumb.rb
54
+ - test/unit/dumb_test.rb
50
55
  - test/lib/dumb.rb
56
+ - test/helper.rb
51
57
  homepage: http://www.bitbucket.org/ToadJamb/gems_test_unit_helper
52
58
  licenses:
53
59
  - LGPLV3
@@ -69,14 +75,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
75
  version: '0'
70
76
  requirements: []
71
77
  rubyforge_project:
72
- rubygems_version: 1.8.10
78
+ rubygems_version: 1.8.24
73
79
  signing_key:
74
80
  specification_version: 3
75
81
  summary: Provides additional functionality to Test::Unit
76
82
  test_files:
77
- - test/helper.rb
83
+ - test/unit/class_methods_test.rb
78
84
  - test/unit/test_test_case.rb
79
- - test/unit/dumb_test.rb
80
- - test/unit/test_dumb.rb
81
85
  - test/unit/output_test.rb
86
+ - test/unit/test_dumb.rb
87
+ - test/unit/dumb_test.rb
82
88
  - test/lib/dumb.rb
89
+ - test/helper.rb
data/README DELETED
@@ -1,82 +0,0 @@
1
- == Welcome to TestUnitHelper
2
-
3
- TestUnitHelper provides additional functionality to Test::Unit.
4
-
5
- == Getting Started
6
-
7
- 1. Install TestUnitHelper at the command prompt if you haven't yet:
8
-
9
- gem install test_unit_helper
10
-
11
- 2. Require the gem in your Gemfile:
12
-
13
- gem 'test_unit_helper', '~> 0.0.1'
14
-
15
- 3. Require the gem wherever you need to use it:
16
-
17
- require 'test_unit_helper'
18
-
19
- == Usage
20
-
21
- This gem adds a number of things to TestCase.
22
- The first one is an addition to the class methods.
23
- A function named 'test' exists
24
- so that you may use the following inside your tests:
25
-
26
- test 'this should pass' do
27
- assert true
28
- end
29
-
30
- If you have a class named MyClass
31
- and your test class is named either TestMyClass or MyClassTest,
32
- an instance variable (@class) will be made available,
33
- which allows for things like:
34
-
35
- def setup
36
- @my_object = @class.new
37
- end
38
-
39
- If your test is named after a class as above,
40
- the following tests illustrate other enhancements:
41
-
42
- test '.some_method does something' do
43
- assert false # => test MyClass.some_method does something (MyClassTest)
44
- end
45
-
46
- test '#some_method does something' do
47
- assert false # => test MyClass#some_method does something (MyClassTest)
48
- end
49
-
50
- The wrap_output instance method has been added.
51
- It traps all output to standard out and standard error
52
- in a way that prevents them from spitting out all through your tests,
53
- but also allows you to check what the results:
54
-
55
- test 'output should be trapped' do
56
- wrap_output { puts 'TestUnitHelper is awesome!' }
57
- assert_equal 'TestUnitHelper is awesome!', out
58
- end
59
-
60
- A reset_io method is available to reset out and err,
61
- if wrap_output will be called multiple times and
62
- you need to clear them in between
63
- (they are automatically reset before each test).
64
-
65
- == Additional Notes
66
-
67
- out and err strip all trailing new lines.
68
- If it is absolutely necessary to compare with the newlines,
69
- @out and @err are available. They are StringIO objects, though.
70
- But the key here is that the only ways they are modified
71
- are when something is added to them (via wrap_output)
72
- or when they are reset.
73
-
74
- == Additional Documentation
75
-
76
- rake rdoc:app
77
-
78
- == License
79
-
80
- TestUnitHelper is released under the {LGPLV3 license}[link:../../license/lgplv3].
81
-
82
- link:../../license/lgplv3.png