test_extensions 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme +31 -16
- metadata +1 -1
data/Readme
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
= QualitySmith Test Extensions
|
2
2
|
|
3
|
-
[<b>Home page</b>:]
|
4
|
-
[<b>Project site</b>:] http://rubyforge.org/projects/
|
3
|
+
[<b>Home page</b>:] soon: http://test-extensions.rubyforge.org/
|
4
|
+
[<b>Project site</b>:] http://rubyforge.org/projects/test-extensions
|
5
|
+
[<b>Gem install</b>:] <tt>gem install test_extensions</tt>
|
5
6
|
[<b>Wiki</b>:] http://wiki.qualitysmith.com/
|
6
7
|
[<b>Author</b>:] Tyler Rick, and others
|
7
8
|
[<b>Copyright</b>:] 2007 QualitySmith, Inc.
|
8
9
|
[<b>License</b>:] {GNU General Public License}[http://www.gnu.org/copyleft/gpl.html]
|
9
10
|
|
10
|
-
==
|
11
|
+
== What it is
|
11
12
|
|
12
13
|
This is a collection of methods and features for Test::Unit that are missing from the standard distribution.
|
13
14
|
|
@@ -15,13 +16,23 @@ This is a collection of methods and features for Test::Unit that are missing fro
|
|
15
16
|
|
16
17
|
=== Color!
|
17
18
|
|
18
|
-
|
19
|
+
The results of test runs are colorized. The failure "F"s and "E"s will now be in color as well as the totals showing how many tests passed (green) and how many failed (you guessed it -- red).
|
19
20
|
|
20
|
-
|
21
|
+
assert_equals will highlight the individual characters that differ when comparing strings! _Very_ helpful for tracking down subtle differences between two large strings.
|
22
|
+
|
23
|
+
Before:
|
24
|
+
|
25
|
+
link:include/assert_equal_with_difference_highlighting-wheres_waldo.png
|
26
|
+
|
27
|
+
After:
|
28
|
+
|
29
|
+
link:include/assert_equal_with_difference_highlighting-there_he_is.png
|
30
|
+
|
31
|
+
See http://qualitysmithext.rubyforge.org/classes/Test/Unit/Assertions.html#M000082 for full details.
|
21
32
|
|
22
33
|
=== Useful assertion methods
|
23
34
|
|
24
|
-
* <b><tt>assert_exception</tt></b>: make
|
35
|
+
* <b><tt>assert_exception</tt></b>: make assertions about an exception that should be raised -- not just the _class_ of the exception but other details like the message
|
25
36
|
* <b><tt>assert_includes</tt></b> / <tt>assert_contains</tt>:</b> assert that +haystack+ contains +needle+; works for anything that responds to <tt>include?</tt> (arrays, strings, ...)
|
26
37
|
* <b><tt>assert_match Regexp.loose_join('key phrase 1', 'key phrase 2')</tt></b>
|
27
38
|
assert_match Regexp.loose_join('key phrase 1', 'key phrase 2'), "Some really long string that you want to make sure contains both key phrase 1 and key phrase 2, in that order, but you don't care too much about the stuff in between, and you don't really want to hand-craft the regular expression or worry about escaping things like '.'s and '*'s yourself."
|
@@ -37,22 +48,26 @@ Rails-specific:
|
|
37
48
|
* <b><tt>capture_output</tt></b> -- captures the standard output/error from the method under test (rather than letting it print to the screen) so that you can make assertions about it.
|
38
49
|
* <b><tt>simulate_input</tt></b> -- if your application is expecting some kind of user input on stdin, this method can be used to simulate the input, so that your test is completely automated and self-contained.
|
39
50
|
|
40
|
-
== Requirements
|
41
|
-
|
42
|
-
Gems:
|
43
|
-
* colored
|
44
|
-
* facets
|
45
|
-
* qualitysmith_extensions
|
46
|
-
|
47
51
|
== Installation
|
48
52
|
|
49
|
-
sudo gem install test_extensions
|
53
|
+
sudo gem install test_extensions --include-dependencies
|
50
54
|
|
51
|
-
Then throw this in your <tt>test_helper.rb</tt>:
|
55
|
+
Then just throw this in your <tt>test_helper.rb</tt>:
|
52
56
|
|
53
57
|
require 'rubygems'
|
54
58
|
gem 'test_extensions'
|
55
59
|
require 'test_extensions'
|
56
60
|
|
57
|
-
... and you're set! All extensions will
|
61
|
+
... and you're set! All extensions will be loaded for you automatically.
|
62
|
+
|
63
|
+
== Requirements
|
64
|
+
|
65
|
+
Gems:
|
66
|
+
* colored
|
67
|
+
* facets
|
68
|
+
* qualitysmith_extensions
|
69
|
+
|
70
|
+
== Problems, questions, comments, or contributions?
|
71
|
+
|
72
|
+
Are welcome! Please direct them to 20070501@tylerrick.com .
|
58
73
|
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: test_extensions
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
6
|
+
version: 0.1.1
|
7
7
|
date: 2007-05-01 00:00:00 -07:00
|
8
8
|
summary: A collection of user-contributed enhancements and new methods for Test::Unit
|
9
9
|
require_paths:
|