qed 2.5.1 → 2.6.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.
- data/HISTORY.rdoc +259 -0
- data/LICENSE.rdoc +35 -0
- data/README.rdoc +20 -28
- data/bin/qedoc +2 -2
- data/lib/{qedoc/command.rb → qed/cli/qedoc.rb} +9 -26
- data/lib/qed/demo.rb +16 -4
- data/lib/{qedoc → qed}/document.rb +82 -36
- data/lib/{qedoc → qed}/document/jquery.js +0 -0
- data/lib/{qedoc → qed}/document/markup.rb +0 -0
- data/lib/{qedoc → qed}/document/template.rhtml +3 -8
- data/lib/qed/evaluator.rb +1 -1
- data/lib/qed/parser.rb +7 -0
- data/lib/qed/reporter/abstract.rb +136 -18
- data/lib/qed/reporter/bullet.rb +29 -17
- data/lib/qed/reporter/dotprogress.rb +14 -11
- data/lib/qed/reporter/dtrace.rb +67 -0
- data/lib/qed/reporter/tapy.rb +224 -0
- data/lib/qed/reporter/verbatim.rb +2 -2
- data/lib/qed/scope.rb +46 -31
- data/lib/qed/session.rb +28 -7
- metadata +12 -33
- data/LICENSE +0 -204
data/HISTORY.rdoc
ADDED
@@ -0,0 +1,259 @@
|
|
1
|
+
= RELEASE HISTORY
|
2
|
+
|
3
|
+
== 2.6.0 / 2011-07-01
|
4
|
+
|
5
|
+
Thie release fixes some issues with reporters, further refines
|
6
|
+
their output and adds the start of a new reporter called dtrace.
|
7
|
+
Also the Table and Data macros have been updated. Table can now
|
8
|
+
handle a YAML stream with the :stream option, and Data no long runs
|
9
|
+
the text through YAML.load whe the file name ends in .yml or .yaml,
|
10
|
+
In other words it's for raw fixture data. Finally the documentation
|
11
|
+
tool has been improved ot simplify HTML generation and also add a
|
12
|
+
format option for creating a simple plain text merging instead.
|
13
|
+
|
14
|
+
Changes:
|
15
|
+
|
16
|
+
* Data is raw and no longer uses YAML.load.
|
17
|
+
* Table can handle a YAML stream, via :stream option.
|
18
|
+
* Better handling of code snippets.
|
19
|
+
* Backtrace count defaults to 2 rather than 3.
|
20
|
+
* Load ansi/core, rather than ansi/code.
|
21
|
+
* Doc output setting takes a file name instead of directory.
|
22
|
+
* Support for plain text format (by simple file merge).
|
23
|
+
* HTML output is single file, jquery comes from CDNJ.
|
24
|
+
|
25
|
+
|
26
|
+
== 2.5.2 / 2011-06-26
|
27
|
+
|
28
|
+
This release focuses on reporter improvements. Better trace
|
29
|
+
information is now displayed, and the max nmber of backtrace
|
30
|
+
lines can be set with the -t option, or $trace environment
|
31
|
+
variable.
|
32
|
+
|
33
|
+
Changes:
|
34
|
+
|
35
|
+
* Trace option takes a max count setting (0 for all).
|
36
|
+
* Trace count can also be set via $trace environment variable.
|
37
|
+
* Added TAP-Y reporter.
|
38
|
+
|
39
|
+
|
40
|
+
== 2.5.1 / 2011-06-07
|
41
|
+
|
42
|
+
This release makes a number adjustments and fixes one majort issue
|
43
|
+
with the way the latest AE library counts assertions.
|
44
|
+
|
45
|
+
Changes:
|
46
|
+
|
47
|
+
* Fix references to AE assertion counts.
|
48
|
+
* @_ stores the return value of last execution block.
|
49
|
+
* Backtrace filter omits references to AE library.
|
50
|
+
|
51
|
+
|
52
|
+
== 2.5.0 / 2010-11-04
|
53
|
+
|
54
|
+
The latest release of QED improves on applique loading, such that each
|
55
|
+
demonstrandum gets it's own localized set. The CLI has also been modified
|
56
|
+
so that there is no longer a defualt location, the directory or files to run
|
57
|
+
must be specified.
|
58
|
+
|
59
|
+
Changes:
|
60
|
+
|
61
|
+
* Better handling of Applique.
|
62
|
+
* Remove Advice class --advice is now stored in Applique.
|
63
|
+
* Each applique file is it's own module.
|
64
|
+
* Advice from each applique is applied.
|
65
|
+
* CLI requires files be specified.
|
66
|
+
|
67
|
+
|
68
|
+
== 2.4.0 / 2010-09-02
|
69
|
+
|
70
|
+
All engines go! QED has not been tested against 1.8.6, 1.8.7 and 1.9.2.
|
71
|
+
Underthehood steps are not organized in doubely-linked lists, which makes
|
72
|
+
them much more robust and flexible. This release also improves scoping,
|
73
|
+
test counts, and inline documentation parsing.
|
74
|
+
|
75
|
+
Changes:
|
76
|
+
|
77
|
+
* Use new doubly-linked list step design.
|
78
|
+
* Fix -r option on command line.
|
79
|
+
* Provide #instance_exec core extension for Ruby 1.8.6.
|
80
|
+
* Scope is extended by and includes applique.
|
81
|
+
|
82
|
+
|
83
|
+
== 2.3.0 / 2010-07-14
|
84
|
+
|
85
|
+
Bug to the scurry! QED has broken through the code/document ceiling and
|
86
|
+
is cracking ectoskeletons all the way to the bank. A proverbal can of
|
87
|
+
Roach-Be-Gone this is! What's that you say? I will exlpain. QED can now
|
88
|
+
run directly against code comments. Simply slip the qed command the -c
|
89
|
+
option and feed it some ruby scripts, and presto watch you commnets
|
90
|
+
fail ;) I think you can figure out what to do next.
|
91
|
+
|
92
|
+
In addition to this coolness QED has been improved under the floor
|
93
|
+
boards as well. The parser, which is much faster, now blocks commentary
|
94
|
+
paragraphs and code examples togeher in one-to-one pairings. Not only
|
95
|
+
does this clean-up the code, but it opens up the potential for Around
|
96
|
+
advice in a future version.
|
97
|
+
|
98
|
+
Changes:
|
99
|
+
|
100
|
+
* NEW! Ruby script comment run mode.
|
101
|
+
* Better parsing system uses commentary-example pairs.
|
102
|
+
* Colon can also be used to specify plain text (along with ellipsis).
|
103
|
+
* Now distributed under the more permissive Apache 2.0 license.
|
104
|
+
|
105
|
+
|
106
|
+
== 2.2.2 / 2010-06-21
|
107
|
+
|
108
|
+
An issue was reported in which the a code block at the very
|
109
|
+
top of a demo was being ignored. This release fixes this issue
|
110
|
+
by rewriting the parser (much better now thanks!). At the same
|
111
|
+
time the Data and Table methods have been polished, both of
|
112
|
+
which can now pick up sample data relative to the current demo.
|
113
|
+
|
114
|
+
Changes:
|
115
|
+
|
116
|
+
* Rewrite parser and fix top code issue.
|
117
|
+
* Data method cannot write data, instead executes block.
|
118
|
+
* Data and Table methods look for file relative to demo first.
|
119
|
+
* Added -R option to run demos relative to project root.
|
120
|
+
|
121
|
+
|
122
|
+
== 2.2.1 / 2010-06-20
|
123
|
+
|
124
|
+
Remove dependencies to Tilt and Nokogiri. Should have
|
125
|
+
done this in last release but alas --there is so
|
126
|
+
much to do.
|
127
|
+
|
128
|
+
Changes:
|
129
|
+
|
130
|
+
* Removed HTML parsing dependencies.
|
131
|
+
* Reduce Advice to a single class.
|
132
|
+
|
133
|
+
|
134
|
+
== 2.2.0 / 2010-06-19
|
135
|
+
|
136
|
+
This release returns to a text-based evaluator, rather
|
137
|
+
then use HTML. Processing HTML proved to have too many
|
138
|
+
edge cases to be effective --both in implementation
|
139
|
+
and in end-usage. So to remedy the situation QED has
|
140
|
+
return to supportting simple markup formats such as
|
141
|
+
RDoc and Markup.
|
142
|
+
|
143
|
+
This release also adds multi-pattern advice. Instead of
|
144
|
+
a single pattern, multiple patterns can be matched
|
145
|
+
sequentially. This make it a easier to match large text
|
146
|
+
descriptions without restoring to regular expressions.
|
147
|
+
|
148
|
+
In addition QED now supports raw text blocks. By ending
|
149
|
+
a description section in ellipsis (...), the subsequent
|
150
|
+
code setion becomes a plain text section and is passed
|
151
|
+
into the argument list of any matching When advice. This
|
152
|
+
makes it easy to scaffold fixture files, for example.
|
153
|
+
|
154
|
+
Finally, this release also refines the evaluation scopes.
|
155
|
+
Where before, a new binding was being created, each was
|
156
|
+
attached to the TOPLEVEL, and therefore not truly isolated
|
157
|
+
on a per-dcoument basis. To correct, QED now mocks the
|
158
|
+
TOPLEVEL providing a new instance of this mock object for
|
159
|
+
each document.
|
160
|
+
|
161
|
+
Changes:
|
162
|
+
|
163
|
+
* No longer uses HTML for document processing.
|
164
|
+
* Support for plain text blocks using ellipsis.
|
165
|
+
* New sequential multi-pattern matches.
|
166
|
+
* Mock TOPLEVEL at both the demo and applique levels.
|
167
|
+
* Adjust color support for latest ANSI release.
|
168
|
+
|
169
|
+
|
170
|
+
== 2.1.1 / 2010-04-08
|
171
|
+
|
172
|
+
Fixed bug introduced in the last version that executed all
|
173
|
+
scripts in a single binding. There needed to be a binding
|
174
|
+
for each script.
|
175
|
+
|
176
|
+
Changes:
|
177
|
+
|
178
|
+
* Fixed cross-script bug by moving binding instantiation into Script class.
|
179
|
+
|
180
|
+
|
181
|
+
== 2.1.0 / 2010-04-07
|
182
|
+
|
183
|
+
QED documents are now run in the TOPLEVEL context, rather
|
184
|
+
than in a subclass of Scope. This ensures code runs as
|
185
|
+
one would expect it too in the wild.
|
186
|
+
|
187
|
+
Changes:
|
188
|
+
|
189
|
+
* Scope.new redirect to TOPLEVEL.
|
190
|
+
* DomainLanguage module is added to include into TOPLEVEL.
|
191
|
+
|
192
|
+
|
193
|
+
== 2.0.0 / 2010-03-04
|
194
|
+
|
195
|
+
This is a major new release of QED. All demonstration documents
|
196
|
+
are now converted to HTML via Tilt (http://github.com/tilt) before
|
197
|
+
being run through the test runner. So QED now supports any markup
|
198
|
+
format supported by Tilt, as well as ordinary HTML. Simply
|
199
|
+
stated, QED process <tt>pre</tt> tags as code and everything else
|
200
|
+
as comments. Nokogiri is used to parse the HTML.
|
201
|
+
|
202
|
+
Changes:
|
203
|
+
|
204
|
+
* HTML serves as a common format.
|
205
|
+
* New dependencies: Tilt and Nokogiri.
|
206
|
+
* New system of version numbers.
|
207
|
+
|
208
|
+
|
209
|
+
== 1.2.0 / 2009-12-07
|
210
|
+
|
211
|
+
This release adds a significant new feature, Comment Matchers.
|
212
|
+
These work like Cucumber allowing for background code to
|
213
|
+
be run when matching comments occur --a much better solution
|
214
|
+
for setup and teardown.
|
215
|
+
|
216
|
+
Changes:
|
217
|
+
|
218
|
+
* 2 Major Enhancements
|
219
|
+
|
220
|
+
* Added command matchers via #When method.
|
221
|
+
* All QED methods are now capitalized.
|
222
|
+
|
223
|
+
* 2 Minor Enhancements
|
224
|
+
|
225
|
+
* Use OptionParser for qed exectuable.
|
226
|
+
* Verbatim reporter is literally verbatim.
|
227
|
+
|
228
|
+
|
229
|
+
== 1.1.1 / 2009-09-05
|
230
|
+
|
231
|
+
This release
|
232
|
+
|
233
|
+
Changes:
|
234
|
+
|
235
|
+
* 2 Major Enhancements
|
236
|
+
|
237
|
+
* Helpers are provided by bottom code.
|
238
|
+
* Added Markdown header support.
|
239
|
+
|
240
|
+
* 2 Minor Enhancements
|
241
|
+
|
242
|
+
* Use Ansi project for color output.
|
243
|
+
* Use latest RDoc version.
|
244
|
+
|
245
|
+
|
246
|
+
== 1.0.0 / 2009-06-30
|
247
|
+
|
248
|
+
QED has found itself. It took some time to really figure out
|
249
|
+
what this project "was" and how it should best be utilized.
|
250
|
+
This release is the initial release that puts QED in proper
|
251
|
+
perpective.
|
252
|
+
|
253
|
+
Changes:
|
254
|
+
|
255
|
+
* 2 Major Enhancement
|
256
|
+
|
257
|
+
* Partial rewrite of a project that was once called "Quarry".
|
258
|
+
* Now uese AE for assertions.
|
259
|
+
|
data/LICENSE.rdoc
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
= COPYRIGHT NOTICES
|
2
|
+
|
3
|
+
== YES
|
4
|
+
|
5
|
+
Copyright:: (c) 2011 Rubyworks, Thomas Sawyer
|
6
|
+
License:: BSD-2-Clause
|
7
|
+
Website:: http://rubyworks.github.com/yes
|
8
|
+
|
9
|
+
Copyright 2011 Thomas Sawyer. All rights reserved.
|
10
|
+
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
12
|
+
modification, are permitted provided that the following conditions are met:
|
13
|
+
|
14
|
+
* Redistributions of source code must retain the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer.
|
16
|
+
|
17
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
18
|
+
this list of conditions and the following disclaimer in the documentation
|
19
|
+
and/or other materials provided with the distribution.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY Thomas Sawyer ``AS IS'' AND ANY EXPRESS
|
22
|
+
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
23
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
24
|
+
NO EVENT SHALL Thomas Sawyer OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
25
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
26
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
28
|
+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
29
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
30
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
|
32
|
+
The views and conclusions contained in the software and documentation are
|
33
|
+
those of the authors and should not be interpreted as representing official
|
34
|
+
policies, either expressed or implied, of Thomas Sawyer.
|
35
|
+
|
data/README.rdoc
CHANGED
@@ -5,32 +5,32 @@
|
|
5
5
|
|
6
6
|
Q.E.D. is an abbreviation for the well known Latin phrase "Quod Erat Demonstrandum",
|
7
7
|
literally "which was to be demonstrated", which is oft written in its abbreviated
|
8
|
-
form at the end of a mathematical proof or philosophical argument to signify
|
8
|
+
form at the end of a mathematical proof or philosophical argument to signify
|
9
9
|
a successful conclusion. And so it is too for Ruby Q.E.D., though it might as easily
|
10
10
|
be taken to stand for "Quality Ensured Documentation".
|
11
11
|
|
12
12
|
QED is in fact both a test framework and a documentation system for Ruby
|
13
13
|
developers. QED sits somewhere between lower-level testing tools like Test::Unit
|
14
|
-
and
|
15
|
-
exceptionally well for <i>API-Driven Design</i>, which is especially
|
16
|
-
designing reusable libraries, but it can be used to test code at
|
17
|
-
of
|
14
|
+
and grandiose requirement specifications systems like Cucumber. In practice it
|
15
|
+
works exceptionally well for <i>API-Driven Design</i>, which is especially
|
16
|
+
useful when designing reusable libraries, but it can be used to test code at
|
17
|
+
any level of abstraction, from unit test to systems tests.
|
18
18
|
|
19
19
|
|
20
20
|
== Features
|
21
21
|
|
22
22
|
* Write tests and documentation in the same breath!
|
23
23
|
* Demos can be RDoc, Markdown or any other conforming text format.
|
24
|
-
* Uses the excellent Assertive Expressive library for assertions.
|
25
|
-
* Table macro allows large sets of data to be
|
24
|
+
* Uses the excellent AE (Assertive Expressive) library for assertions.
|
25
|
+
* Table macro allows large sets of data to be tested by the same code.
|
26
26
|
* Documentation tool provides nice output with jQuery-based TOC.
|
27
27
|
|
28
28
|
|
29
29
|
== Resources
|
30
30
|
|
31
|
-
*
|
32
|
-
*
|
33
|
-
*
|
31
|
+
* {Homepage}[http://rubyworks.github.com/qed]
|
32
|
+
* {Mailing list}[http://groups.google.com/group/rubyworks-mailinglist]
|
33
|
+
* {Development}[http://github.com/rubyworks/qed]
|
34
34
|
|
35
35
|
|
36
36
|
== Synopsis
|
@@ -90,15 +90,16 @@ To run a document through QED, simply use the +qed+ command.
|
|
90
90
|
The <code>-v</code> option specifies verbatim mode, which outputs the entire
|
91
91
|
document.
|
92
92
|
|
93
|
-
Notice we placed the QED document in
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
it helps order the documents
|
93
|
+
Notice we placed the QED document in a <code>demo/</code> directory, this is no
|
94
|
+
standard place that demonstrations have to go. They can be placed anywhere
|
95
|
+
in a project that is preferred (lately I've been use qed/). Also notice the
|
96
|
+
`<code>01_</code>` prefix in front of the name. While this is not strictly
|
97
|
+
necessary, it helps order the documents nicely in particular when generating
|
98
|
+
QED documentation ("QEDocs").
|
98
99
|
|
99
|
-
===
|
100
|
+
=== Utilizing Applique
|
100
101
|
|
101
|
-
QED demonstrandum descriptive text is not
|
102
|
+
QED demonstrandum descriptive text is not strictly passive explanation. Using
|
102
103
|
pattern matching techniques, document phrases can trigger underlying actions.
|
103
104
|
These actions provide a support structure for running tests called the *applique*.
|
104
105
|
|
@@ -156,15 +157,6 @@ Q.E.D.
|
|
156
157
|
|
157
158
|
Copyright (c) 2007 Thomas Sawyer
|
158
159
|
|
159
|
-
|
160
|
-
you may not use this file except in compliance with the License.
|
161
|
-
You may obtain a copy of the License at
|
162
|
-
|
163
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
164
|
-
|
165
|
-
Unless required by applicable law or agreed to in writing, software
|
166
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
167
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
168
|
-
See the License for the specific language governing permissions and
|
169
|
-
limitations under the License.
|
160
|
+
BSD 2-Clause License
|
170
161
|
|
162
|
+
See LICENSE.rdoc for details.
|
data/bin/qedoc
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require 'qedoc
|
3
|
-
|
2
|
+
require 'qed/cli/qedoc'
|
3
|
+
QED::Document.cli(*ARGV)
|
@@ -1,29 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module QEDoc
|
1
|
+
module QED
|
4
2
|
|
5
3
|
require 'optparse'
|
6
|
-
require '
|
7
|
-
|
8
|
-
class Command
|
4
|
+
require 'qed/document'
|
9
5
|
|
10
|
-
|
11
|
-
def self.run
|
12
|
-
new.run
|
13
|
-
end
|
6
|
+
class Document
|
14
7
|
|
15
|
-
#
|
16
|
-
|
8
|
+
# Command line interface for generating qedocs.
|
9
|
+
def self.cli(*argv)
|
17
10
|
|
18
|
-
|
19
|
-
def initialize
|
20
|
-
@options = {}
|
21
|
-
end
|
22
|
-
|
23
|
-
#
|
24
|
-
def parser
|
25
|
-
OptionParser.new do |usage|
|
11
|
+
options = {}
|
26
12
|
|
13
|
+
parser = OptionParser.new do |usage|
|
27
14
|
usage.banner = "Usage: qedoc [OPTIONS] <QEDFile1> [ <QEDFile2> ... ]"
|
28
15
|
|
29
16
|
usage.on("-o", "--output [DIR]", "Output directory") do |dir|
|
@@ -50,15 +37,11 @@ module QEDoc
|
|
50
37
|
puts usage
|
51
38
|
exit
|
52
39
|
end
|
53
|
-
|
54
40
|
end
|
55
|
-
end
|
56
41
|
|
57
|
-
|
58
|
-
def run
|
59
|
-
parser.parse!
|
42
|
+
parser.parse!(argv)
|
60
43
|
|
61
|
-
options[:paths] =
|
44
|
+
options[:paths] = argv.dup
|
62
45
|
|
63
46
|
#opts[:output] = cli.options[:file]
|
64
47
|
#opts[:dryrun] = cli.options[:dryrun]
|
data/lib/qed/demo.rb
CHANGED
@@ -85,11 +85,23 @@ module QED
|
|
85
85
|
)
|
86
86
|
end
|
87
87
|
|
88
|
-
#
|
88
|
+
# Demo steps, cached from parsing.
|
89
89
|
#
|
90
|
-
#
|
91
|
-
def
|
92
|
-
|
90
|
+
# @return [Array] parsed steps
|
91
|
+
def steps
|
92
|
+
@steps ||= parser.parse
|
93
|
+
end
|
94
|
+
|
95
|
+
# Parse and cache demonstration script.
|
96
|
+
#
|
97
|
+
# @return [Array] abstract syntax tree
|
98
|
+
alias_method :parse, :steps
|
99
|
+
|
100
|
+
# Get a new Parser instance for this demo.
|
101
|
+
#
|
102
|
+
# @return [Parser] parser for this demo
|
103
|
+
def parser
|
104
|
+
Parser.new(file, :mode=>mode)
|
93
105
|
end
|
94
106
|
|
95
107
|
#
|