dfect 1.0.0 → 1.1.0

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.
@@ -28,13 +28,21 @@
28
28
  });
29
29
 
30
30
  $('#search')[0].value == '' && $('#search-label').show();
31
-
32
- setInterval(function() { $('#search')[0].value != '' && $('#search-label').hide() }, 100)
33
31
  }
34
32
  $(function() {
35
- placeholder();
36
- new Searchdoc.Panel($('#panel'), search_data, tree, top.frames[1]);
37
- $('#search').focus();
33
+ placeholder();
34
+ var panel = new Searchdoc.Panel($('#panel'), search_data, tree, top.frames[1]);
35
+ $('#search').focus();
36
+
37
+ var s = window.parent.location.search.match(/\?q=([^&]+)/);
38
+ if (s) {
39
+ s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
40
+ if (s.length > 0)
41
+ {
42
+ $('#search').val(s);
43
+ panel.search(s, true);
44
+ }
45
+ }
38
46
  })
39
47
  //]]>
40
48
  </script>
@@ -1 +1 @@
1
- var search_data = {"index":{"info":[["Dfect","lib\/dfect.rb","classes\/Dfect.html","","",1],["Kernel","lib\/dfect\/spec.rb","classes\/Kernel.html","","",1],["Object","lib\/dfect\/auto.rb","classes\/Object.html"," < Object","",1],["<","Dfect","classes\/Dfect.html#M000008","(*args, &block)","Registers the given block to be executed before each nested test inside this test. ==== Examples D .<",2],["<<","Dfect","classes\/Dfect.html#M000010","(&block)","Registers the given block to be executed before all nested tests inside this test. ==== Examples D .<<",2],[">","Dfect","classes\/Dfect.html#M000009","(&block)","Registers the given block to be executed after each nested test inside this test. ==== Examples D .>",2],[">>","Dfect","classes\/Dfect.html#M000011","(&block)","Registers the given block to be executed after all nested tests inside this test. ==== Examples D .>>",2],["C","Dfect","classes\/Dfect.html#M000019","(message = nil, symbol = nil, &block)","Asserts that the given symbol is thrown when the given block is executed. If a value is thrown along",2],["C!","Dfect","classes\/Dfect.html#M000020","(message = nil, symbol = nil, &block)","Asserts that the given symbol is not thrown when the given block is executed. Returns nil, always. ====",2],["C?","Dfect","classes\/Dfect.html#M000021","(message = nil, symbol = nil, &block)","Returns true if the given symbol is thrown when the given block is executed. Otherwise, returns false.",2],["D","Dfect","classes\/Dfect.html#M000007","(description = caller.first, &block)","Defines a new test, composed of the given description and the given block to execute. A test may contain",2],["E","Dfect","classes\/Dfect.html#M000016","(message = nil, *kinds, &block)","Asserts that one of the given kinds of exceptions is raised when the given block is executed. If the",2],["E!","Dfect","classes\/Dfect.html#M000017","(message = nil, *kinds, &block)","Asserts that one of the given kinds of exceptions is not raised when the given block is executed. If",2],["E?","Dfect","classes\/Dfect.html#M000018","(message = nil, *kinds, &block)","Returns true if one of the given kinds of exceptions is raised when the given block is executed. Otherwise,",2],["F?","Dfect","classes\/Dfect.html#M000015","(message = nil, &block)","Returns true if the result of the given block is either nil or false. Otherwise, returns false. ====",2],["T","Dfect","classes\/Dfect.html#M000012","(message = nil, &block)","Asserts that the result of the given block is neither nil nor false and returns that result. ==== Parameters",2],["T!","Dfect","classes\/Dfect.html#M000013","(message = nil, &block)","Asserts that the result of the given block is either nil or false and returns that result. ==== Parameters",2],["T?","Dfect","classes\/Dfect.html#M000014","(message = nil, &block)","Returns true if the result of the given block is neither nil nor false. Otherwise, returns false. ====",2],["after","Kernel","classes\/Kernel.html#M000006","(what, &block)","",2],["before","Kernel","classes\/Kernel.html#M000005","(what, &block)","",2],["context","Kernel","classes\/Kernel.html#M000003","(*args, &block)","Alias for #describe",2],["describe","Kernel","classes\/Kernel.html#M000002","(*args, &block)","",2],["it","Kernel","classes\/Kernel.html#M000004","(*args, &block)","Alias for #describe",2],["run","Dfect","classes\/Dfect.html#M000022","(continue = true)","Executes all tests defined thus far and stores the results in #report. ==== Parameters [continue] If",2],["setup","Kernel","classes\/Kernel.html#M000000","(&block)","",2],["stop","Dfect","classes\/Dfect.html#M000023","()","Stops the execution of the #run method or raises an exception if that method is not currently executing.",2],["teardown","Kernel","classes\/Kernel.html#M000001","(&block)","",2],["CREDITS","files\/CREDITS.html","files\/CREDITS.html","","* [Fran\u00e7ois Beausoleil](http:\/\/github.com\/francois) ",3],["LICENSE","files\/LICENSE.html","files\/LICENSE.html","","(the ISC license) Copyright 2009 Suraj N. Kurapati <sunaku@gmail.com> Permission to use, copy, modify,",3],["dfect.rb","files\/lib\/dfect_rb.html","files\/lib\/dfect_rb.html",""," ",3],["auto.rb","files\/lib\/dfect\/auto_rb.html","files\/lib\/dfect\/auto_rb.html","","Provides painless, automatic configuration of Dfect. Simply require() this file and Dfect will be available",3],["mini.rb","files\/lib\/dfect\/mini_rb.html","files\/lib\/dfect\/mini_rb.html","","MiniTest emulation layer. ",3],["spec.rb","files\/lib\/dfect\/spec_rb.html","files\/lib\/dfect\/spec_rb.html","","RSpec emulation layer. ",3],["unit.rb","files\/lib\/dfect\/unit_rb.html","files\/lib\/dfect\/unit_rb.html","","Test::Unit emulation layer. ",3]],"searchIndex":["dfect","kernel","object","<()","<<()",">()",">>()","c()","c!()","c?()","d()","e()","e!()","e?()","f?()","t()","t!()","t?()","after()","before()","context()","describe()","it()","run()","setup()","stop()","teardown()","credits","license","dfect.rb","auto.rb","mini.rb","spec.rb","unit.rb"],"longSearchIndex":["dfect.rb","spec.rb","auto.rb","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","kernel","kernel","kernel","kernel","kernel","dfect","kernel","dfect","kernel","files\/credits.html","files\/license.html","files\/lib\/dfect_rb.html","files\/lib\/dfect\/auto_rb.html","files\/lib\/dfect\/mini_rb.html","files\/lib\/dfect\/spec_rb.html","files\/lib\/dfect\/unit_rb.html"]}}
1
+ var search_data = {"index":{"searchIndex":["dfect","kernel","object","<()","<<()",">()",">>()","c()","c!()","c?()","d()","e()","e!()","e?()","f?()","s()","t()","t!()","t?()","after()","before()","context()","describe()","it()","run()","setup()","stop()","teardown()","credits","license","dfect.rb","auto.rb","mini.rb","spec.rb","unit.rb"],"longSearchIndex":["lib/dfect.rb","lib/dfect/spec.rb","lib/dfect/auto.rb","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","dfect","kernel","kernel","kernel","kernel","kernel","dfect","kernel","dfect","kernel","files/credits.html","files/license.html","files/lib/dfect_rb.html","files/lib/dfect/auto_rb.html","files/lib/dfect/mini_rb.html","files/lib/dfect/spec_rb.html","files/lib/dfect/unit_rb.html"],"info":[["Dfect","lib/dfect.rb","classes/Dfect.html"," < ","",1],["Kernel","lib/dfect/spec.rb","classes/Kernel.html"," < ","",1],["Object","lib/dfect/auto.rb","classes/Object.html"," < Object","",1],["<","Dfect","classes/Dfect.html#M000008","(*args, &block)","Registers the given block to be executed before each nested test inside this test. ==== Examples D .<",2],["<<","Dfect","classes/Dfect.html#M000010","(&block)","Registers the given block to be executed before all nested tests inside this test. ==== Examples D .<<",2],[">","Dfect","classes/Dfect.html#M000009","(&block)","Registers the given block to be executed after each nested test inside this test. ==== Examples D .>",2],[">>","Dfect","classes/Dfect.html#M000011","(&block)","Registers the given block to be executed after all nested tests inside this test. ==== Examples D .>>",2],["C","Dfect","classes/Dfect.html#M000019","(message = nil, symbol = nil, &block)","Asserts that the given symbol is thrown when the given block is executed. If a value is thrown along",2],["C!","Dfect","classes/Dfect.html#M000020","(message = nil, symbol = nil, &block)","Asserts that the given symbol is not thrown when the given block is executed. Returns nil, always. ====",2],["C?","Dfect","classes/Dfect.html#M000021","(message = nil, symbol = nil, &block)","Returns true if the given symbol is thrown when the given block is executed. Otherwise, returns false.",2],["D","Dfect","classes/Dfect.html#M000007","(description = caller.first, &block)","Defines a new test, composed of the given description and the given block to execute. A test may contain",2],["E","Dfect","classes/Dfect.html#M000016","(message = nil, *kinds, &block)","Asserts that one of the given kinds of exceptions is raised when the given block is executed. If the",2],["E!","Dfect","classes/Dfect.html#M000017","(message = nil, *kinds, &block)","Asserts that one of the given kinds of exceptions is not raised when the given block is executed. If",2],["E?","Dfect","classes/Dfect.html#M000018","(message = nil, *kinds, &block)","Returns true if one of the given kinds of exceptions is raised when the given block is executed. Otherwise,",2],["F?","Dfect","classes/Dfect.html#M000015","(message = nil, &block)","Returns true if the result of the given block is either nil or false. Otherwise, returns false. ====",2],["S","Dfect","classes/Dfect.html#M000022","(*message)","Adds the given message to the report inside the section of the currently running test. You can think",2],["T","Dfect","classes/Dfect.html#M000012","(message = nil, &block)","Asserts that the result of the given block is neither nil nor false and returns that result. ==== Parameters",2],["T!","Dfect","classes/Dfect.html#M000013","(message = nil, &block)","Asserts that the result of the given block is either nil or false and returns that result. ==== Parameters",2],["T?","Dfect","classes/Dfect.html#M000014","(message = nil, &block)","Returns true if the result of the given block is neither nil nor false. Otherwise, returns false. ====",2],["after","Kernel","classes/Kernel.html#M000006","(what, &block)","",2],["before","Kernel","classes/Kernel.html#M000005","(what, &block)","",2],["context","Kernel","classes/Kernel.html#M000003","(*args, &block)","Alias for #describe",2],["describe","Kernel","classes/Kernel.html#M000002","(*args, &block)","",2],["it","Kernel","classes/Kernel.html#M000004","(*args, &block)","Alias for #describe",2],["run","Dfect","classes/Dfect.html#M000023","(continue = true)","Executes all tests defined thus far and stores the results in #report. ==== Parameters [continue] If",2],["setup","Kernel","classes/Kernel.html#M000000","(&block)","",2],["stop","Dfect","classes/Dfect.html#M000024","()","Stops the execution of the #run method or raises an exception if that method is not currently executing.",2],["teardown","Kernel","classes/Kernel.html#M000001","(&block)","",2],["CREDITS","files/CREDITS.html","files/CREDITS.html","","* [Fran\u00e7ois Beausoleil](http://github.com/francois) * [I\u00f1aki Baz Castillo](http://github.com/ibc) ",3],["LICENSE","files/LICENSE.html","files/LICENSE.html","","(the ISC license) Copyright 2009 Suraj N. Kurapati <sunaku@gmail.com> Permission to use, copy, modify,",3],["dfect.rb","files/lib/dfect_rb.html","files/lib/dfect_rb.html",""," ",3],["auto.rb","files/lib/dfect/auto_rb.html","files/lib/dfect/auto_rb.html","","Provides painless, automatic configuration of Dfect. Simply require() this file and Dfect will be available",3],["mini.rb","files/lib/dfect/mini_rb.html","files/lib/dfect/mini_rb.html","","MiniTest emulation layer. ",3],["spec.rb","files/lib/dfect/spec_rb.html","files/lib/dfect/spec_rb.html","","RSpec emulation layer. ",3],["unit.rb","files/lib/dfect/unit_rb.html","files/lib/dfect/unit_rb.html","","Test::Unit emulation layer. ",3]]}}
@@ -1 +1 @@
1
- var tree = [["Dfect","classes\/Dfect.html","",[]],["Kernel","classes\/Kernel.html","",[]],["Object","classes\/Object.html"," < Object",[]]]
1
+ var tree = [["","","files",[["CREDITS","files/CREDITS.html","",[]],["LICENSE","files/LICENSE.html","",[]],["","","lib",[["","","dfect",[["auto.rb","files/lib/dfect/auto_rb.html","",[]],["mini.rb","files/lib/dfect/mini_rb.html","",[]],["spec.rb","files/lib/dfect/spec_rb.html","",[]],["unit.rb","files/lib/dfect/unit_rb.html","",[]]]],["dfect.rb","files/lib/dfect_rb.html","",[]]]]]],["Dfect","classes/Dfect.html","",[]],["Kernel","classes/Kernel.html","",[]],["Object","classes/Object.html"," < Object",[]]]
data/doc/history.erb CHANGED
@@ -1,45 +1,97 @@
1
1
  %#--
2
- %# Copyright 2009 Suraj N. Kurapati
3
- %# See the LICENSE file for details.
2
+ %# Copyright protects this work.
3
+ %# See LICENSE file for details.
4
4
  %#++
5
5
 
6
+
6
7
  %|chapter "History"
7
- % sean_ohalpin_musing = "[Sean O'Halpin's musing](http://www.ruby-forum.com/topic/183354#801895)"
8
+
8
9
 
9
10
  %|history
10
- For the longest time, I took <%= competitors.link_for 'Test::Unit' %> and <%= competitors.link_for 'RSpec' %> for granted. They were the epitomy of modern Ruby practice; the insurmountable status quo; immortalized in books, conferences, and blogs alike.
11
11
 
12
- Why would *anyone* think of using anything remotely different, let alone be foolish enough to write an alternative testing library when these are clearly *good enough*?
13
12
 
14
- Recent experiments in assertion testing libraries smashed my world view:
15
- * <%= competitors.link_for 'assert{ 2.0 }' %>
16
- * <%= competitors.link_for 'Testy' %>
17
- * <%= competitors.link_for 'Verify' %>
13
+ %|section "Version 1.1.0 (2009-10-27)"
14
+
15
+ This release adds a new method for emitting status messages and does some internal housekeeping.
16
+
17
+
18
+ %|paragraph "Thank you"
19
+
20
+ * Iñaki Baz Castillo used Dfect and suggested new features.
21
+
22
+
23
+ %|paragraph "New features"
24
+
25
+ * Add `Dfect::S()` method for <%= xref "Reporting", "adding status messages" %> to the execution report. This feature was [requested by](http://github.com/sunaku/dfect/issues/closed#issue/1) Iñaki Baz Castillo.
26
+
27
+
28
+ %|paragraph "Housekeeping"
29
+
30
+ * Remove unused require of 'delegate' standard library in 'dfect/spec' RSpec emulation layer.
31
+
32
+ * Mention <%= xref "Emulation" %> layers for popular testing libraries.
33
+
34
+ * Mention that assertions take an optional message parameter.
35
+
36
+ * Replace sample unit test with Dfect test suite.
37
+
38
+ * Upgrade user manual to ERBook 9.0.0.
39
+
40
+
41
+ %|section "Version 1.0.1 (2009-10-07)"
42
+
43
+ This release fixes a bug in the Test::Unit emulation library and revises the user manual.
44
+
45
+
46
+ %|paragraph "Bug fixes"
47
+
48
+ * The parameters for the `assert_equal()` method in the <tt>dfect/unit</tt> library were in the wrong order.
49
+
50
+
51
+ %|paragraph "Housekeeping"
52
+
53
+ * Revise user manual to better fit jQuery UI tabs.
54
+
55
+ * Justify the use of `eval()` in emulation libraries.
18
56
 
19
- The status quo was certainly *not* "good enough", as I had so blindly believed all these years. In fact, they were *verbose* behemoths that chose to encode endless permutations of conjecture into methods.
57
+ * Use simpler Copyright reminder at the top of every file.
58
+
59
+ * Make SLOC count in user manual reflect the *core* library only.
60
+
61
+ * Mark code spans with `{:lang=ruby}` instead of HTML `<code/>` tags.
62
+
63
+ * Open source is for fun, so [be nice](http://loiclemeur.com/english/2009/03/never-criticize-your-competitors.html): speak of "related works" instead of "competitors".
20
64
 
21
- Empowered by this revelation and inspired by <%= sean_ohalpin_musing %> on alternative names for assertion methods, I rose to challenge the status quo.
22
65
 
23
66
  %|section "Version 1.0.0 (2009-05-03)"
67
+
24
68
  This release improves default choices, adds emulation layers to mimic other testing libraries, and fixes some bugs.
25
69
 
70
+
26
71
  %|paragraph "Incompatible changes"
72
+
27
73
  * The `:debug` option is now enabled by default and is no longer linked to the value of `$DEBUG`.
28
74
 
29
75
  * `Dfect.run()` now appends to previous results by default.
30
76
 
31
77
  This behavior can be disabled by passing `false` to the method.
32
78
 
79
+
33
80
  %|paragraph "New features"
81
+
34
82
  * Add emulation layers to mimic other testing libraries:
35
83
  * <tt>dfect/unit</tt> --- Test::Unit
36
84
  * <tt>dfect/mini</tt> --- Minitest
37
85
  * <tt>dfect/spec</tt> --- RSpec
38
86
 
87
+
39
88
  %|paragraph "Bug fixes"
89
+
40
90
  * Do not blindly replace `Class#to_yaml`; it might be fixed someday.
41
91
 
92
+
42
93
  %|paragraph "Housekeeping"
94
+
43
95
  * Add <%= xref "Motivation" %> section in user manual to promote interactive debugging.
44
96
 
45
97
  * Add brief <%= xref "History" %> of this project's inception.
@@ -48,20 +100,28 @@
48
100
 
49
101
  * Add copyright notice at the top of every file.
50
102
 
103
+
51
104
  %|section "Version 0.1.0 (2009-04-28)"
105
+
52
106
  This release adds new variations to assertion methods, fixes several bugs, and improves test coverage.
53
107
 
108
+
54
109
  %|paragraph "Thank you"
110
+
55
111
  * François Beausoleil contributed patches for both code *and* tests! :-)
56
112
 
113
+
57
114
  %|paragraph "New features"
115
+
58
116
  * Added <%= xref "Negation", "negation (m!)" %> and <%= xref "Sampling", "sampling (m?)" %> variations to <%= xref "Assertions", "assertion methods" %>.
59
117
 
60
118
  These new methods implement assertion functionality missing so far (previously we could not assert that a given exception was NOT thrown) and thereby allow us to fully test Dfect using itself.
61
119
 
62
120
  * Added documentation on <%= xref "Insulation", "how to insulate tests" %> from the global Ruby namespace.
63
121
 
122
+
64
123
  %|paragraph "Bug fixes"
124
+
65
125
  * The `E()` method did not consider the case where a block does not raise anything as a failure. ---*François Beausoleil*
66
126
 
67
127
  * When creating a report about an assertion failure, an exception would be thrown if any local variables pointed to an empty array.
@@ -74,8 +134,28 @@
74
134
 
75
135
  TypeError: can't dump anonymous class Class
76
136
 
137
+
77
138
  %|paragraph "Housekeeping"
139
+
78
140
  * Filled the big holes in test coverage. Everything except the runtime debugging logic is now covered by the unit tests.
79
141
 
142
+
80
143
  %|section "Version 0.0.0 (2009-04-13)"
81
- This is the first public release of <%= $project %>. It was inspired by <%= sean_ohalpin_musing %> on alternative names for assertion methods.
144
+
145
+ % sean_ohalpin_musing = "[Sean O'Halpin's musing](http://www.ruby-forum.com/topic/183354#801895)"
146
+
147
+ For the longest time, I took <%= related_works.link_for 'Test::Unit' %> and <%= related_works.link_for 'RSpec' %> for granted. They were the epitomy of modern Ruby practice; the insurmountable status quo; immortalized in books, conferences, and blogs alike.
148
+
149
+ Why would *anyone* think of using anything remotely different, let alone be foolish enough to write an alternative testing library when these are clearly *good enough*?
150
+
151
+ Recent experiments in assertion testing libraries smashed my world view:
152
+ * <%= related_works.link_for 'assert{ 2.0 }' %>
153
+ * <%= related_works.link_for 'Testy' %>
154
+ * <%= related_works.link_for 'Verify' %>
155
+
156
+ The status quo was certainly *not* "good enough", as I had so blindly believed all these years. In fact, they were *verbose* behemoths that chose to encode endless permutations of conjecture into methods.
157
+
158
+ Empowered by this revelation and inspired by <%= sean_ohalpin_musing %> on alternative names for assertion methods, I rose to challenge the status quo.
159
+
160
+ And so I present to you the first public release of <%= $project %>.
161
+
data/doc/index.erb CHANGED
@@ -1,6 +1,6 @@
1
1
  %#--
2
- %# Copyright 2009 Suraj N. Kurapati
3
- %# See the LICENSE file for details.
2
+ %# Copyright protects this work.
3
+ %# See LICENSE file for details.
4
4
  %#++
5
5
 
6
6
  % Inochi.book :Dfect, self