assertions 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Manifest.txt +2 -1
- data/README.txt +71 -47
- data/Rakefile +1 -1
- data/examples/example.rb +39 -0
- metadata +8 -6
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
= assertions
|
2
|
-
Project Page: http://rubyforge.org/projects/assertions/
|
2
|
+
* Project Page: http://rubyforge.org/projects/assertions/
|
3
|
+
* Documentation: http://assertions.rubyforge.org/
|
3
4
|
|
4
5
|
== DESCRIPTION:
|
5
6
|
This package adds some additional assertions to Test::Unit::Assertions,
|
@@ -18,44 +19,47 @@ including:
|
|
18
19
|
None (known).
|
19
20
|
|
20
21
|
== SYNOPSIS:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
22
|
+
======+examples/example.rb+:
|
23
|
+
#!/usr/bin/env ruby
|
24
|
+
require 'rubygems'
|
25
|
+
require 'assertions'
|
26
|
+
|
27
|
+
require 'test/unit'
|
28
|
+
|
29
|
+
class Tests < Test::Unit::TestCase
|
30
|
+
def test_assertions
|
31
|
+
#
|
32
|
+
# Verify that 4 < 5
|
33
|
+
#
|
34
|
+
assert_less_than(4, 5)
|
35
|
+
|
36
|
+
#
|
37
|
+
# Verify that 4 < 5 again, but this time with the
|
38
|
+
# shorter alias.
|
39
|
+
#
|
40
|
+
assert_lt(4, 5)
|
41
|
+
|
42
|
+
#
|
43
|
+
# Verify that 5 >= 5
|
44
|
+
#
|
45
|
+
assert_ge(5, 5)
|
46
|
+
|
47
|
+
#
|
48
|
+
# Verify that the specified exception is raised.
|
49
|
+
#
|
50
|
+
assert_raise_message("Hello, exception!", RuntimeError) do
|
51
|
+
raise "Hello, exception!"
|
52
|
+
end
|
53
|
+
|
54
|
+
#
|
55
|
+
# Verify that an assertion failed.
|
56
|
+
#
|
57
|
+
assert_fail do
|
58
|
+
assert_equal(5, 4)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
59
63
|
|
60
64
|
== REQUIREMENTS:
|
61
65
|
Hoe is required but only for running the tests.
|
@@ -64,13 +68,9 @@ Hoe is required but only for running the tests.
|
|
64
68
|
sudo gem install assertions
|
65
69
|
|
66
70
|
== AUTHORS:
|
67
|
-
|
68
71
|
=== Designing Patterns
|
69
|
-
|
70
|
-
http://
|
71
|
-
|
72
|
-
==== Blogs
|
73
|
-
http://blogs.designingpatterns.com
|
72
|
+
* Homepage: http://www.designingpatterns.com
|
73
|
+
* Blogs: http://blogs.designingpatterns.com
|
74
74
|
|
75
75
|
== SUPPORT
|
76
76
|
Please post questions, concerns, or requests for enhancement to the forums on
|
@@ -86,6 +86,30 @@ so if there is an enhancement that *must* get done (and in a specified time
|
|
86
86
|
frame), please inquire about retaining our services!
|
87
87
|
|
88
88
|
== LICENSE:
|
89
|
-
|
89
|
+
The license text can be found in the +LICENSE+ file at the root of the
|
90
|
+
distribution.
|
91
|
+
|
92
|
+
This package is licensed with an MIT license:
|
93
|
+
|
94
|
+
Copyright (c) 2008 Designing Patterns
|
95
|
+
|
96
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
97
|
+
a copy of this software and associated documentation files (the
|
98
|
+
'Software'), to deal in the Software without restriction, including
|
99
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
100
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
101
|
+
permit persons to whom the Software is furnished to do so, subject to
|
102
|
+
the following conditions:
|
103
|
+
|
104
|
+
The above copyright notice and this permission notice shall be
|
105
|
+
included in all copies or substantial portions of the Software.
|
106
|
+
|
107
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
108
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
109
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
110
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
111
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
112
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
113
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
90
114
|
|
91
|
-
==
|
115
|
+
== SHARE AND ENJOY!
|
data/Rakefile
CHANGED
data/examples/example.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'assertions'
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
|
7
|
+
class Tests < Test::Unit::TestCase
|
8
|
+
def test_assertions
|
9
|
+
#
|
10
|
+
# Verify that 4 < 5
|
11
|
+
#
|
12
|
+
assert_less_than(4, 5)
|
13
|
+
|
14
|
+
#
|
15
|
+
# Verify that 4 < 5 again, but this time with the
|
16
|
+
# shorter alias.
|
17
|
+
#
|
18
|
+
assert_lt(4, 5)
|
19
|
+
|
20
|
+
#
|
21
|
+
# Verify that 5 >= 5
|
22
|
+
#
|
23
|
+
assert_ge(5, 5)
|
24
|
+
|
25
|
+
#
|
26
|
+
# Verify that the specified exception is raised.
|
27
|
+
#
|
28
|
+
assert_raise_message("Hello, exception!", RuntimeError) do
|
29
|
+
raise "Hello, exception!"
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Verify that an assertion failed.
|
34
|
+
#
|
35
|
+
assert_fail do
|
36
|
+
assert_equal(5, 4)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assertions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DesigningPatterns
|
@@ -9,17 +9,18 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-06-
|
12
|
+
date: 2008-06-26 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hoe
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
20
21
|
- - ">="
|
21
22
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.
|
23
|
+
version: 1.6.0
|
23
24
|
version:
|
24
25
|
description: "This package adds some additional assertions to Test::Unit::Assertions, including: * Assertions for all of the comparison operators (assert_greater_than, assert_less_than_or_equal_to, etc.). Shorter aliases also are provided for these (assert_gt, assert_le, etc.). * An assertion that verifies that a given block raises a specified exception with a specified message (assert_raise_message). This allows full testing of error messages. * An assertion that verifies that a given block contains an assertion that fails (assert_fail), which can be used to test new assertions."
|
25
26
|
email:
|
@@ -30,14 +31,15 @@ extensions: []
|
|
30
31
|
|
31
32
|
extra_rdoc_files:
|
32
33
|
- Manifest.txt
|
33
|
-
- README.txt
|
34
34
|
- History.txt
|
35
|
+
- README.txt
|
35
36
|
files:
|
36
37
|
- Manifest.txt
|
37
38
|
- LICENSE
|
38
|
-
- README.txt
|
39
39
|
- History.txt
|
40
|
+
- README.txt
|
40
41
|
- Rakefile
|
42
|
+
- examples/example.rb
|
41
43
|
- lib/assertions.rb
|
42
44
|
- test/test_assertions.rb
|
43
45
|
has_rdoc: true
|
@@ -63,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
65
|
requirements: []
|
64
66
|
|
65
67
|
rubyforge_project: assertions
|
66
|
-
rubygems_version: 1.0
|
68
|
+
rubygems_version: 1.2.0
|
67
69
|
signing_key:
|
68
70
|
specification_version: 2
|
69
71
|
summary: "This package adds some additional assertions to Test::Unit::Assertions, including: * Assertions for all of the comparison operators (assert_greater_than, assert_less_than_or_equal_to, etc.)"
|