rushcheck 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/Rakefile +1 -3
  2. data/Rakefile.in +37 -0
  3. data/data/rushcheck/doc/rushcheck.thtml +20 -0
  4. data/data/rushcheck/rdoc/classes/FalseClass.html +17 -17
  5. data/data/rushcheck/rdoc/classes/FalseClass.src/M000006.html +18 -0
  6. data/data/rushcheck/rdoc/classes/FalseClass.src/M000007.html +18 -0
  7. data/data/rushcheck/rdoc/classes/FalseClass.src/M000008.html +18 -0
  8. data/data/rushcheck/rdoc/classes/Float.html +21 -21
  9. data/data/rushcheck/rdoc/classes/Float.src/M000015.html +21 -0
  10. data/data/rushcheck/rdoc/classes/Float.src/M000016.html +18 -0
  11. data/data/rushcheck/rdoc/classes/Float.src/M000017.html +22 -0
  12. data/data/rushcheck/rdoc/classes/Float.src/M000018.html +20 -0
  13. data/data/rushcheck/rdoc/classes/Integer.html +28 -29
  14. data/data/rushcheck/rdoc/classes/Integer.src/M000001.html +18 -0
  15. data/data/rushcheck/rdoc/classes/Integer.src/M000002.html +18 -0
  16. data/data/rushcheck/rdoc/classes/Integer.src/M000003.html +25 -0
  17. data/data/rushcheck/rdoc/classes/Integer.src/M000004.html +19 -0
  18. data/data/rushcheck/rdoc/classes/NilClass.html +17 -17
  19. data/data/rushcheck/rdoc/classes/NilClass.src/M000023.html +18 -0
  20. data/data/rushcheck/rdoc/classes/NilClass.src/M000024.html +18 -0
  21. data/data/rushcheck/rdoc/classes/NilClass.src/M000025.html +18 -0
  22. data/data/rushcheck/rdoc/classes/RandomArray.html +16 -16
  23. data/data/rushcheck/rdoc/classes/RandomArray.src/M000009.html +19 -0
  24. data/data/rushcheck/rdoc/classes/RandomArray.src/M000010.html +35 -0
  25. data/data/rushcheck/rdoc/classes/RandomArray.src/M000011.html +22 -0
  26. data/data/rushcheck/rdoc/classes/RandomHash.html +17 -17
  27. data/data/rushcheck/rdoc/classes/RandomHash.src/M000012.html +19 -0
  28. data/data/rushcheck/rdoc/classes/RandomHash.src/M000013.html +26 -0
  29. data/data/rushcheck/rdoc/classes/RandomHash.src/M000014.html +22 -0
  30. data/data/rushcheck/rdoc/classes/RandomProc.html +22 -22
  31. data/data/rushcheck/rdoc/classes/RandomProc.src/M000019.html +18 -0
  32. data/data/rushcheck/rdoc/classes/RandomProc.src/M000020.html +30 -0
  33. data/data/rushcheck/rdoc/classes/RandomProc.src/M000021.html +26 -0
  34. data/data/rushcheck/rdoc/classes/RandomProc.src/M000022.html +20 -0
  35. data/data/rushcheck/rdoc/classes/RushCheck.html +218 -0
  36. data/data/rushcheck/rdoc/classes/RushCheck.src/M000033.html +18 -0
  37. data/data/rushcheck/rdoc/classes/RushCheck.src/M000034.html +27 -0
  38. data/data/rushcheck/rdoc/classes/RushCheck/Arbitrary.html +136 -0
  39. data/data/rushcheck/rdoc/classes/RushCheck/Arbitrary.src/M000035.html +18 -0
  40. data/data/rushcheck/rdoc/classes/RushCheck/Assertion.html +187 -0
  41. data/data/rushcheck/rdoc/classes/RushCheck/Assertion.src/M000073.html +20 -0
  42. data/data/rushcheck/rdoc/classes/RushCheck/Assertion.src/M000074.html +50 -0
  43. data/data/rushcheck/rdoc/classes/RushCheck/Coarbitrary.html +135 -0
  44. data/data/rushcheck/rdoc/classes/RushCheck/Coarbitrary.src/M000058.html +18 -0
  45. data/data/rushcheck/rdoc/classes/RushCheck/Config.html +270 -0
  46. data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000066.html +23 -0
  47. data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000067.html +22 -0
  48. data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000068.html +22 -0
  49. data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000069.html +18 -0
  50. data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000070.html +38 -0
  51. data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000071.html +55 -0
  52. data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000072.html +50 -0
  53. data/data/rushcheck/rdoc/classes/RushCheck/Gen.html +558 -0
  54. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000075.html +18 -0
  55. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000076.html +41 -0
  56. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000077.html +18 -0
  57. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000078.html +20 -0
  58. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000079.html +28 -0
  59. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000080.html +24 -0
  60. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000081.html +18 -0
  61. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000082.html +18 -0
  62. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000083.html +18 -0
  63. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000084.html +18 -0
  64. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000085.html +18 -0
  65. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000086.html +24 -0
  66. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000087.html +18 -0
  67. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000088.html +21 -0
  68. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000089.html +18 -0
  69. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000090.html +18 -0
  70. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000091.html +23 -0
  71. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000092.html +19 -0
  72. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000093.html +18 -0
  73. data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000094.html +24 -0
  74. data/data/rushcheck/rdoc/classes/RushCheck/GuardException.html +111 -0
  75. data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.html +201 -0
  76. data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.src/M000041.html +22 -0
  77. data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.src/M000042.html +32 -0
  78. data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.src/M000043.html +18 -0
  79. data/data/rushcheck/rdoc/classes/RushCheck/Property.html +174 -0
  80. data/data/rushcheck/rdoc/classes/RushCheck/Property.src/M000105.html +26 -0
  81. data/data/rushcheck/rdoc/classes/RushCheck/Property.src/M000106.html +18 -0
  82. data/data/rushcheck/rdoc/classes/RushCheck/RandomBool.html +146 -0
  83. data/data/rushcheck/rdoc/classes/RushCheck/RandomBool.src/M000039.html +18 -0
  84. data/data/rushcheck/rdoc/classes/RushCheck/RandomBool.src/M000040.html +19 -0
  85. data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.html +196 -0
  86. data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.src/M000036.html +18 -0
  87. data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.src/M000037.html +18 -0
  88. data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.src/M000038.html +18 -0
  89. data/data/rushcheck/rdoc/classes/RushCheck/Result.html +214 -0
  90. data/data/rushcheck/rdoc/classes/RushCheck/Result.src/M000095.html +18 -0
  91. data/data/rushcheck/rdoc/classes/RushCheck/Result.src/M000096.html +18 -0
  92. data/data/rushcheck/rdoc/classes/RushCheck/Result.src/M000097.html +18 -0
  93. data/data/rushcheck/rdoc/classes/RushCheck/StdGen.html +252 -0
  94. data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000061.html +23 -0
  95. data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000062.html +21 -0
  96. data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000063.html +21 -0
  97. data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000064.html +18 -0
  98. data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000065.html +18 -0
  99. data/data/rushcheck/rdoc/classes/RushCheck/TestExausted.html +113 -0
  100. data/data/rushcheck/rdoc/classes/RushCheck/TestFailed.html +155 -0
  101. data/data/rushcheck/rdoc/classes/RushCheck/TestFailed.src/M000099.html +18 -0
  102. data/data/rushcheck/rdoc/classes/RushCheck/TestOk.html +113 -0
  103. data/data/rushcheck/rdoc/classes/RushCheck/TestOptions.html +172 -0
  104. data/data/rushcheck/rdoc/classes/RushCheck/TestOptions.src/M000059.html +18 -0
  105. data/data/rushcheck/rdoc/classes/RushCheck/TestOptions.src/M000060.html +18 -0
  106. data/data/rushcheck/rdoc/classes/RushCheck/TestResult.html +160 -0
  107. data/data/rushcheck/rdoc/classes/RushCheck/TestResult.src/M000100.html +18 -0
  108. data/data/rushcheck/rdoc/classes/RushCheck/Testable.html +326 -0
  109. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000044.html +18 -0
  110. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000045.html +18 -0
  111. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000048.html +18 -0
  112. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000049.html +18 -0
  113. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000050.html +18 -0
  114. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000052.html +19 -0
  115. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000053.html +21 -0
  116. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000054.html +18 -0
  117. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000056.html +18 -0
  118. data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000057.html +18 -0
  119. data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.html +200 -0
  120. data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000101.html +18 -0
  121. data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000102.html +20 -0
  122. data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000103.html +21 -0
  123. data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000104.html +18 -0
  124. data/data/rushcheck/rdoc/classes/SpecialString.html +5 -5
  125. data/data/rushcheck/rdoc/classes/SpecialString.src/M000005.html +37 -0
  126. data/data/rushcheck/rdoc/classes/String.html +21 -21
  127. data/data/rushcheck/rdoc/classes/String.src/M000026.html +24 -0
  128. data/data/rushcheck/rdoc/classes/String.src/M000027.html +18 -0
  129. data/data/rushcheck/rdoc/classes/String.src/M000028.html +25 -0
  130. data/data/rushcheck/rdoc/classes/String.src/M000029.html +22 -0
  131. data/data/rushcheck/rdoc/classes/TrueClass.html +17 -17
  132. data/data/rushcheck/rdoc/classes/TrueClass.src/M000030.html +18 -0
  133. data/data/rushcheck/rdoc/classes/TrueClass.src/M000031.html +18 -0
  134. data/data/rushcheck/rdoc/classes/TrueClass.src/M000032.html +18 -0
  135. data/data/rushcheck/rdoc/created.rid +1 -1
  136. data/data/rushcheck/rdoc/files/rushcheck/arbitrary_rb.html +5 -8
  137. data/data/rushcheck/rdoc/files/rushcheck/array_rb.html +1 -1
  138. data/data/rushcheck/rdoc/files/rushcheck/assertion_rb.html +2 -3
  139. data/data/rushcheck/rdoc/files/rushcheck/bool_rb.html +3 -2
  140. data/data/rushcheck/rdoc/files/rushcheck/config_rb.html +3 -4
  141. data/data/rushcheck/rdoc/files/rushcheck/float_rb.html +3 -3
  142. data/data/rushcheck/rdoc/files/rushcheck/gen_rb.html +5 -5
  143. data/data/rushcheck/rdoc/files/rushcheck/guard_rb.html +2 -2
  144. data/data/rushcheck/rdoc/files/rushcheck/hash_rb.html +1 -1
  145. data/data/rushcheck/rdoc/files/rushcheck/integer_rb.html +2 -2
  146. data/data/rushcheck/rdoc/files/rushcheck/proc_rb.html +1 -1
  147. data/data/rushcheck/rdoc/files/rushcheck/property_rb.html +3 -4
  148. data/data/rushcheck/rdoc/files/rushcheck/random_rb.html +3 -6
  149. data/data/rushcheck/rdoc/files/rushcheck/result_rb.html +3 -4
  150. data/data/rushcheck/rdoc/files/rushcheck/string_rb.html +4 -4
  151. data/data/rushcheck/rdoc/files/rushcheck/testable_rb.html +2 -3
  152. data/data/rushcheck/rdoc/files/rushcheck/testoptions_rb.html +3 -3
  153. data/data/rushcheck/rdoc/files/rushcheck/testresult_rb.html +1 -1
  154. data/data/rushcheck/rdoc/files/rushcheck_rb.html +5 -4
  155. data/data/rushcheck/rdoc/fr_class_index.html +20 -20
  156. data/data/rushcheck/rdoc/fr_method_index.html +106 -105
  157. data/lib/rushcheck.rb +1 -0
  158. data/lib/rushcheck/assertion.rb +9 -4
  159. data/lib/rushcheck/gen.rb +1 -1
  160. data/lib/rushcheck/version.rb +8 -0
  161. data/lib/rushcheck/version.rb.in +8 -0
  162. metadata +144 -2
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>guard (RushCheck)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/guard.rb, line 8</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">guard</span>
15
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">GuardException</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">yield</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>guard_raise (RushCheck)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/guard.rb, line 12</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">guard_raise</span>(<span class="ruby-identifier">c</span>)
15
+ <span class="ruby-keyword kw">begin</span>
16
+ <span class="ruby-keyword kw">yield</span>
17
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ex</span>
18
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">ex</span>
19
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">c</span>
20
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">GuardException</span>
21
+ <span class="ruby-keyword kw">else</span>
22
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">ex</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-keyword kw">end</span></pre>
26
+ </body>
27
+ </html>
@@ -0,0 +1,136 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: RushCheck::Arbitrary</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">RushCheck::Arbitrary</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/rushcheck/arbitrary_rb.html">
59
+ rushcheck/arbitrary.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000035">arbitrary</a>&nbsp;&nbsp;
84
+ </div>
85
+ </div>
86
+
87
+ </div>
88
+
89
+
90
+ <!-- if includes -->
91
+
92
+ <div id="section">
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <!-- if method_list -->
102
+ <div id="methods">
103
+ <h3 class="section-bar">Public Instance methods</h3>
104
+
105
+ <div id="method-M000035" class="method-detail">
106
+ <a name="M000035"></a>
107
+
108
+ <div class="method-heading">
109
+ <a href="Arbitrary.src/M000035.html" target="Code" class="method-signature"
110
+ onclick="popupCode('Arbitrary.src/M000035.html');return false;">
111
+ <span class="method-name">arbitrary</span><span class="method-args">()</span>
112
+ </a>
113
+ </div>
114
+
115
+ <div class="method-description">
116
+ <p>
117
+ It is assumed that the arbitrary method must be overrided and return a <a
118
+ href="Gen.html">Gen</a> object with the same class of self. See also
119
+ rushcheck/gen.rb.
120
+ </p>
121
+ </div>
122
+ </div>
123
+
124
+
125
+ </div>
126
+
127
+
128
+ </div>
129
+
130
+
131
+ <div id="validator-badges">
132
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
133
+ </div>
134
+
135
+ </body>
136
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>arbitrary (RushCheck::Arbitrary)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/arbitrary.rb, line 16</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">arbitrary</span>
15
+ <span class="ruby-identifier">raise</span>(<span class="ruby-constant">NotImplementedError</span>, <span class="ruby-value str">&quot;This method should be overrided.&quot;</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,187 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: RushCheck::Assertion</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">RushCheck::Assertion</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/rushcheck/assertion_rb.html">
59
+ rushcheck/assertion.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ <a href="Assertion.html">Assertion</a> class is one of main features of <a
84
+ href="../RushCheck.html">RushCheck</a>. You can write a testcase for random
85
+ testing as follows:
86
+ </p>
87
+ <p>
88
+ <a href="Assertion.html#M000073">Assertion.new</a>(<a
89
+ href="../Integer.html">Integer</a>, <a href="../String.html">String</a>) do
90
+ |x, y|
91
+ </p>
92
+ <pre>
93
+ RushCheck::guard { precondition }
94
+ body
95
+ </pre>
96
+ <p>
97
+ end
98
+ </p>
99
+ <p>
100
+ Note that the number of arguments in the block must be equal to the number
101
+ of arguments of <a href="Assertion.html#M000073">Assertion.new</a>. See
102
+ also the <a href="../RushCheck.html">RushCheck</a> tutorial and several
103
+ examples.
104
+ </p>
105
+
106
+ </div>
107
+
108
+
109
+ </div>
110
+
111
+ <div id="method-list">
112
+ <h3 class="section-bar">Methods</h3>
113
+
114
+ <div class="name-list">
115
+ <a href="#M000073">new</a>&nbsp;&nbsp;
116
+ <a href="#M000074">property</a>&nbsp;&nbsp;
117
+ </div>
118
+ </div>
119
+
120
+ </div>
121
+
122
+
123
+ <!-- if includes -->
124
+ <div id="includes">
125
+ <h3 class="section-bar">Included Modules</h3>
126
+
127
+ <div id="includes-list">
128
+ <span class="include-name"><a href="Testable.html">RushCheck::Testable</a></span>
129
+ </div>
130
+ </div>
131
+
132
+ <div id="section">
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <!-- if method_list -->
142
+ <div id="methods">
143
+ <h3 class="section-bar">Public Class methods</h3>
144
+
145
+ <div id="method-M000073" class="method-detail">
146
+ <a name="M000073"></a>
147
+
148
+ <div class="method-heading">
149
+ <a href="Assertion.src/M000073.html" target="Code" class="method-signature"
150
+ onclick="popupCode('Assertion.src/M000073.html');return false;">
151
+ <span class="method-name">new</span><span class="method-args">(*xs, &amp;f)</span>
152
+ </a>
153
+ </div>
154
+
155
+ <div class="method-description">
156
+ </div>
157
+ </div>
158
+
159
+ <h3 class="section-bar">Public Instance methods</h3>
160
+
161
+ <div id="method-M000074" class="method-detail">
162
+ <a name="M000074"></a>
163
+
164
+ <div class="method-heading">
165
+ <a href="Assertion.src/M000074.html" target="Code" class="method-signature"
166
+ onclick="popupCode('Assertion.src/M000074.html');return false;">
167
+ <span class="method-name">property</span><span class="method-args">()</span>
168
+ </a>
169
+ </div>
170
+
171
+ <div class="method-description">
172
+ </div>
173
+ </div>
174
+
175
+
176
+ </div>
177
+
178
+
179
+ </div>
180
+
181
+
182
+ <div id="validator-badges">
183
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
184
+ </div>
185
+
186
+ </body>
187
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (RushCheck::Assertion)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/assertion.rb, line 28</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">xs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">f</span>)
15
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">xs</span>.<span class="ruby-identifier">length</span>
16
+ <span class="ruby-ivar">@inputs</span> = <span class="ruby-identifier">xs</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)]
17
+ <span class="ruby-ivar">@proc</span> = <span class="ruby-identifier">f</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>property (RushCheck::Assertion)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/assertion.rb, line 34</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">property</span>
15
+ <span class="ruby-identifier">g</span> = <span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Gen</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
16
+ <span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@inputs</span>
18
+ <span class="ruby-keyword kw">then</span>
19
+ <span class="ruby-ivar">@inputs</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
20
+ <span class="ruby-identifier">r1</span>, <span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r2</span>.<span class="ruby-identifier">split</span>
21
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">arbitrary</span>.<span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r1</span>)
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">else</span>
24
+ []
25
+ <span class="ruby-keyword kw">end</span>
26
+ <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">bind</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
27
+ <span class="ruby-identifier">test</span> = <span class="ruby-keyword kw">begin</span>
28
+ <span class="ruby-ivar">@proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
29
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ex</span>
30
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">ex</span>
31
+ <span class="ruby-keyword kw">when</span> <span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">GuardException</span>
32
+ <span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>)
33
+ <span class="ruby-keyword kw">else</span>
34
+ <span class="ruby-identifier">err</span> = <span class="ruby-node">&quot;Unexpected exception: #{ex.inspect}\n&quot;</span> <span class="ruby-operator">+</span>
35
+ <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
36
+ <span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">false</span>, [], [<span class="ruby-identifier">err</span>])
37
+ <span class="ruby-keyword kw">end</span>
38
+ <span class="ruby-keyword kw">end</span>
39
+ <span class="ruby-comment cmt"># not use ensure here because ensure clause</span>
40
+ <span class="ruby-comment cmt"># does not return values</span>
41
+ <span class="ruby-identifier">test</span>.<span class="ruby-identifier">property</span>.<span class="ruby-identifier">gen</span>.<span class="ruby-identifier">fmap</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">res</span><span class="ruby-operator">|</span>
42
+ <span class="ruby-identifier">res</span>.<span class="ruby-identifier">arguments</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">inspect</span>
43
+ <span class="ruby-identifier">res</span>
44
+ <span class="ruby-keyword kw">end</span>
45
+ <span class="ruby-keyword kw">end</span>
46
+
47
+ <span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Property</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">g</span>)
48
+ <span class="ruby-keyword kw">end</span></pre>
49
+ </body>
50
+ </html>