qed 2.9.0 → 2.9.1
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/.index +69 -0
- data/.yardopts +3 -2
- data/{HISTORY.rdoc → HISTORY.md} +44 -32
- data/LICENSE.txt +25 -0
- data/{README.rdoc → README.md} +60 -51
- data/{qed/01_demos.rdoc → demo/01_demos.md} +3 -3
- data/{qed/02_advice.rdoc → demo/02_advice.md} +17 -17
- data/{qed/03_helpers.rdoc → demo/03_helpers.md} +10 -10
- data/{qed/04_samples.rdoc → demo/04_samples.md} +5 -5
- data/{qed/05_quote.rdoc → demo/05_quote.md} +7 -7
- data/{qed/07_toplevel.rdoc → demo/07_toplevel.md} +11 -11
- data/{qed/08_cross_script.rdoc → demo/08_cross_script.md} +9 -9
- data/{qed/09_cross_script.rdoc → demo/09_cross_script.md} +13 -14
- data/demo/10_constant_lookup.md +16 -0
- data/{qed/11_embedded_rules.rdoc → demo/11_embedded_rules.md} +13 -13
- data/{qed/99_issues/02_topcode.rdoc → demo/99_issues/02_topcode.md} +0 -0
- data/{qed → demo}/applique/ae.rb +0 -0
- data/{qed → demo}/applique/constant.rb +0 -0
- data/{qed → demo}/applique/env.rb +0 -0
- data/{qed → demo}/applique/fileutils.rb +0 -0
- data/{qed → demo}/applique/markup.rb +0 -0
- data/demo/applique/quote.md +8 -0
- data/{qed → demo}/applique/toplevel.rb +0 -0
- data/{qed → demo}/helpers/advice.rb +0 -0
- data/{qed → demo}/helpers/toplevel.rb +0 -0
- data/{qed → demo}/samples/data.txt +0 -0
- data/{qed → demo}/samples/table.yml +0 -0
- data/lib/qed.yml +41 -42
- data/lib/qed/cli.rb +2 -4
- data/lib/qed/cli/qed.rb +30 -3
- data/lib/qed/evaluator.rb +4 -1
- data/lib/qed/reporter/abstract.rb +1 -1
- data/lib/qed/session.rb +9 -2
- data/lib/qed/settings.rb +6 -122
- data/lib/qed/utils.rb +125 -0
- metadata +80 -56
- data/.config.rb +0 -24
- data/.ruby +0 -70
- data/COPYING.rdoc +0 -31
- data/lib/qed/rc.rb +0 -12
- data/qed/10_constant_lookup.rdoc +0 -16
- data/qed/applique/quote.rdoc +0 -8
data/.index
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
---
|
2
|
+
revision: 2013
|
3
|
+
type: ruby
|
4
|
+
sources:
|
5
|
+
- var
|
6
|
+
authors:
|
7
|
+
- name: Trans
|
8
|
+
email: transfire@gmail.com
|
9
|
+
organizations: []
|
10
|
+
requirements:
|
11
|
+
- name: ansi
|
12
|
+
- name: brass
|
13
|
+
- version: 2.8+
|
14
|
+
name: facets
|
15
|
+
- groups:
|
16
|
+
- optional
|
17
|
+
- test
|
18
|
+
development: true
|
19
|
+
name: blankslate
|
20
|
+
- groups:
|
21
|
+
- test
|
22
|
+
development: true
|
23
|
+
name: ae
|
24
|
+
- groups:
|
25
|
+
- build
|
26
|
+
development: true
|
27
|
+
name: detroit
|
28
|
+
- groups:
|
29
|
+
- build
|
30
|
+
development: true
|
31
|
+
name: ergo
|
32
|
+
conflicts: []
|
33
|
+
alternatives: []
|
34
|
+
resources:
|
35
|
+
- type: home
|
36
|
+
uri: http://rubyworks.github.com/qed
|
37
|
+
label: Homepage
|
38
|
+
- type: code
|
39
|
+
uri: http://github.com/rubyworks/qed
|
40
|
+
label: Source Code
|
41
|
+
- type: mail
|
42
|
+
uri: http://groups.google.com/groups/rubyworks-mailinglist
|
43
|
+
label: Mailing List
|
44
|
+
- type: bugs
|
45
|
+
uri: http://github.com/rubyworks/qed/issues
|
46
|
+
label: Issue Tracker
|
47
|
+
repositories:
|
48
|
+
- name: upstream
|
49
|
+
scm: git
|
50
|
+
uri: git://github.com/rubyworks/qed.git
|
51
|
+
categories: []
|
52
|
+
copyrights:
|
53
|
+
- holder: Thomas Sawyer, Rubyworks
|
54
|
+
year: '2006'
|
55
|
+
license: BSD-2-Clause
|
56
|
+
customs: []
|
57
|
+
paths:
|
58
|
+
lib:
|
59
|
+
- lib
|
60
|
+
created: '2009-06-16'
|
61
|
+
summary: Quod Erat Demonstrandum
|
62
|
+
title: QED
|
63
|
+
version: 2.9.1
|
64
|
+
name: qed
|
65
|
+
webcvs: http://github.com/rubyworks/qed/blob/master/
|
66
|
+
description: ! 'QED (Quality Ensured Demonstrations) is a TDD/BDD framework
|
67
|
+
|
68
|
+
utilizing Literate Programming techniques.'
|
69
|
+
date: '2013-02-18'
|
data/.yardopts
CHANGED
data/{HISTORY.rdoc → HISTORY.md}
RENAMED
@@ -1,12 +1,24 @@
|
|
1
|
-
|
1
|
+
# RELEASE HISTORY
|
2
2
|
|
3
|
-
|
3
|
+
## 2.9.1 | 2013-02-20
|
4
|
+
|
5
|
+
The RC gem is optional now and old school `etc/qed.rb`, `config/qed.rb` and
|
6
|
+
`.qed` are all supported again.
|
7
|
+
|
8
|
+
Changes:
|
9
|
+
|
10
|
+
* Resupport traditional config files.
|
11
|
+
* Make RC optional dependency.
|
12
|
+
* Add support for Markdown-style helper links.
|
13
|
+
|
14
|
+
|
15
|
+
## 2.9.0 | 2012-05-19
|
4
16
|
|
5
17
|
IMPORTANT! The `.qed` configuration file is no longer used for configuration.
|
6
|
-
Either use a unified `
|
7
|
-
`-r` option, e.g. `qed -r ./config/cov.rb`.
|
18
|
+
Either use a unified `.ruby` or `.rubyrc` file or require a special config file
|
19
|
+
via the `-r` option, e.g. `qed -r ./config/cov.rb`.
|
8
20
|
|
9
|
-
|
21
|
+
General configuration is now handled by the RC library. The only other
|
10
22
|
form of configuration supported is that of requiring a special file
|
11
23
|
directly via `-r ./path/to/file.rb`. This keeps the code as
|
12
24
|
simple as possible without giving-up functionality. Because the old
|
@@ -19,7 +31,7 @@ Changes:
|
|
19
31
|
* Improve hash-arrow assertion notation.
|
20
32
|
|
21
33
|
|
22
|
-
|
34
|
+
## 2.8.8 | 2012-03-17
|
23
35
|
|
24
36
|
Feel like a heel after the last four releases. The simplest solution
|
25
37
|
to the configuration issue is to allow traditional configuration
|
@@ -31,7 +43,7 @@ Changes:
|
|
31
43
|
* Traditional configuration trump Confection configuration.
|
32
44
|
|
33
45
|
|
34
|
-
|
46
|
+
## 2.8.7 | 2012-03-16
|
35
47
|
|
36
48
|
Release fixes a bug that prevented default demo locations from being
|
37
49
|
used when none are specified on the command line. Also change way
|
@@ -44,7 +56,7 @@ Changes:
|
|
44
56
|
* Change environment variable to config='legacy' to deactivate Confection.
|
45
57
|
|
46
58
|
|
47
|
-
|
59
|
+
## 2.8.6 | 2012-03-15
|
48
60
|
|
49
61
|
This release simply make the configuration more versatile by supporting
|
50
62
|
Confection, task directory and traditional `.qed` configuration.
|
@@ -54,7 +66,7 @@ Changes:
|
|
54
66
|
* Support variety of configuration systems.
|
55
67
|
|
56
68
|
|
57
|
-
|
69
|
+
## 2.8.5 | 2012-03-14 19:00
|
58
70
|
|
59
71
|
Minor release simply make sure configuration file(s) were distributed
|
60
72
|
with package. Part of the new idea that configurations can be
|
@@ -65,7 +77,7 @@ Changes:
|
|
65
77
|
* Include configuration files in distribution.
|
66
78
|
|
67
79
|
|
68
|
-
|
80
|
+
## 2.8.4 | 2012-03-14 18:06
|
69
81
|
|
70
82
|
Just a fix of a method that should have been renamed. Nothing to see here.
|
71
83
|
|
@@ -74,7 +86,7 @@ Changes:
|
|
74
86
|
* Renamed #config_override to #configless?.
|
75
87
|
|
76
88
|
|
77
|
-
|
89
|
+
## 2.8.3 | 2012-03-14 18:00
|
78
90
|
|
79
91
|
What a difference a week makes ;) The Confection library has been substantially
|
80
92
|
improved and if that trend continues at all then I think it will be well worth
|
@@ -92,7 +104,7 @@ Changes:
|
|
92
104
|
* Deprecated use of `.map` configuration redirection file.
|
93
105
|
|
94
106
|
|
95
|
-
|
107
|
+
## 2.8.2 | 2012-03-07
|
96
108
|
|
97
109
|
This release simply reverts the configuration file back to an
|
98
110
|
independent file. The use of the Confection library was a "noble
|
@@ -110,7 +122,7 @@ Changes:
|
|
110
122
|
* Revert to dedicated configuration file.
|
111
123
|
|
112
124
|
|
113
|
-
|
125
|
+
## 2.8.1 | 2012-02-01
|
114
126
|
|
115
127
|
This release fixes a bug in the parsing of `#=>` notation. It also
|
116
128
|
adds syntax highlighting to qedoc generated documentation. It does
|
@@ -122,7 +134,7 @@ Changes:
|
|
122
134
|
* Add highlight.js to qedocs.
|
123
135
|
|
124
136
|
|
125
|
-
|
137
|
+
## 2.8.0 | 2012-01-19
|
126
138
|
|
127
139
|
IMPORTANT: READ THIS RELEASE NOTICE! This release makes a minor
|
128
140
|
change, but it is one that will effect all end-users. That is, QED no
|
@@ -141,7 +153,7 @@ Changes:
|
|
141
153
|
* Complies with assertion standards set by BRASS project.
|
142
154
|
|
143
155
|
|
144
|
-
|
156
|
+
## 2.7.0 | 2011-11-18
|
145
157
|
|
146
158
|
The focus of this release is a much improved underlying API, including
|
147
159
|
a better event model and the application of SOLID principles to really
|
@@ -177,7 +189,7 @@ Changes:
|
|
177
189
|
* Rework API taking SOLID principles into consideration.
|
178
190
|
|
179
191
|
|
180
|
-
|
192
|
+
## 2.6.3 | 2011-10-23
|
181
193
|
|
182
194
|
Fixed output status. When tests fail or error the `qed`
|
183
195
|
command with exit -1 instead to 0. Also, the default
|
@@ -190,7 +202,7 @@ Changes:
|
|
190
202
|
* Fix default spec location to only use one or the other.
|
191
203
|
|
192
204
|
|
193
|
-
|
205
|
+
## 2.6.1 | 2011-07-02
|
194
206
|
|
195
207
|
A friend suggested QED default the load path to lib and
|
196
208
|
automatically look for QED demos in default locations
|
@@ -204,7 +216,7 @@ Changes:
|
|
204
216
|
* Fix website links (you might actually find things now).
|
205
217
|
|
206
218
|
|
207
|
-
|
219
|
+
## 2.6.0 | 2011-07-01
|
208
220
|
|
209
221
|
This release fixes some issues with reporters, further refines
|
210
222
|
their output and adds the start of a new reporter called dtrace.
|
@@ -227,7 +239,7 @@ Changes:
|
|
227
239
|
* HTML output is single file, jquery comes from CDNJ.
|
228
240
|
|
229
241
|
|
230
|
-
|
242
|
+
## 2.5.2 | 2011-06-26
|
231
243
|
|
232
244
|
This release focuses on reporter improvements. Better trace
|
233
245
|
information is now displayed, and the max number of backtrace
|
@@ -241,7 +253,7 @@ Changes:
|
|
241
253
|
* Added TAP-Y reporter.
|
242
254
|
|
243
255
|
|
244
|
-
|
256
|
+
## 2.5.1 | 2011-06-07
|
245
257
|
|
246
258
|
This release makes a number adjustments and fixes one major issue
|
247
259
|
with the way the latest AE library counts assertions.
|
@@ -253,7 +265,7 @@ Changes:
|
|
253
265
|
* Backtrace filter omits references to AE library.
|
254
266
|
|
255
267
|
|
256
|
-
|
268
|
+
## 2.5.0 | 2010-11-04
|
257
269
|
|
258
270
|
The latest release of QED improves on applique loading, such that each
|
259
271
|
demonstrandum gets it's own localized set. The CLI has also been modified
|
@@ -269,7 +281,7 @@ Changes:
|
|
269
281
|
* CLI requires files be specified.
|
270
282
|
|
271
283
|
|
272
|
-
|
284
|
+
## 2.4.0 | 2010-09-02
|
273
285
|
|
274
286
|
All engines go! QED has not been tested against 1.8.6, 1.8.7 and 1.9.2.
|
275
287
|
Underthehood steps are not organized in doubly-linked lists, which makes
|
@@ -284,7 +296,7 @@ Changes:
|
|
284
296
|
* Scope is extended by and includes applique.
|
285
297
|
|
286
298
|
|
287
|
-
|
299
|
+
## 2.3.0 | 2010-07-14
|
288
300
|
|
289
301
|
Bug to the scurry! QED has broken through the code/document ceiling and
|
290
302
|
is cracking exoskeletons all the way to the bank. A proverbial can of
|
@@ -307,7 +319,7 @@ Changes:
|
|
307
319
|
* Now distributed under the more permissive Apache 2.0 license.
|
308
320
|
|
309
321
|
|
310
|
-
|
322
|
+
## 2.2.2 | 2010-06-21
|
311
323
|
|
312
324
|
An issue was reported in which the a code block at the very
|
313
325
|
top of a demo was being ignored. This release fixes this issue
|
@@ -323,7 +335,7 @@ Changes:
|
|
323
335
|
* Added -R option to run demos relative to project root.
|
324
336
|
|
325
337
|
|
326
|
-
|
338
|
+
## 2.2.1 | 2010-06-20
|
327
339
|
|
328
340
|
Remove dependencies to Tilt and Nokogiri. Should have
|
329
341
|
done this in last release but alas --there is so
|
@@ -335,7 +347,7 @@ Changes:
|
|
335
347
|
* Reduce Advice to a single class.
|
336
348
|
|
337
349
|
|
338
|
-
|
350
|
+
## 2.2.0 | 2010-06-19
|
339
351
|
|
340
352
|
This release returns to a text-based evaluator, rather
|
341
353
|
then use HTML. Processing HTML proved to have too many
|
@@ -371,7 +383,7 @@ Changes:
|
|
371
383
|
* Adjust color support for latest ANSI release.
|
372
384
|
|
373
385
|
|
374
|
-
|
386
|
+
## 2.1.1 | 2010-04-08
|
375
387
|
|
376
388
|
Fixed bug introduced in the last version that executed all
|
377
389
|
scripts in a single binding. There needed to be a binding
|
@@ -382,7 +394,7 @@ Changes:
|
|
382
394
|
* Fixed cross-script bug by moving binding instantiation into Script class.
|
383
395
|
|
384
396
|
|
385
|
-
|
397
|
+
## 2.1.0 | 2010-04-07
|
386
398
|
|
387
399
|
QED documents are now run in the TOPLEVEL context, rather
|
388
400
|
than in a subclass of Scope. This ensures code runs as
|
@@ -394,7 +406,7 @@ Changes:
|
|
394
406
|
* DomainLanguage module is added to include into TOPLEVEL.
|
395
407
|
|
396
408
|
|
397
|
-
|
409
|
+
## 2.0.0 | 2010-03-04
|
398
410
|
|
399
411
|
This is a major new release of QED. All demonstration documents
|
400
412
|
are now converted to HTML via Tilt (http://github.com/tilt) before
|
@@ -410,7 +422,7 @@ Changes:
|
|
410
422
|
* New system of version numbers.
|
411
423
|
|
412
424
|
|
413
|
-
|
425
|
+
## 1.2.0 | 2009-12-07
|
414
426
|
|
415
427
|
This release adds a significant new feature, Comment Matchers.
|
416
428
|
These work like Cucumber allowing for background code to
|
@@ -430,7 +442,7 @@ Changes:
|
|
430
442
|
* Verbatim reporter is literally verbatim.
|
431
443
|
|
432
444
|
|
433
|
-
|
445
|
+
## 1.1.1 | 2009-09-05
|
434
446
|
|
435
447
|
This release needs a description.
|
436
448
|
|
@@ -447,7 +459,7 @@ Changes:
|
|
447
459
|
* Use latest RDoc version.
|
448
460
|
|
449
461
|
|
450
|
-
|
462
|
+
## 1.0.0 | 2009-06-30
|
451
463
|
|
452
464
|
QED has found itself. It took some time to really figure out
|
453
465
|
what this project "was" and how it should best be utilized.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
BSD-2-Clause License
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
5
|
+
|
6
|
+
* Redistributions of source code must retain the above copyright notice,
|
7
|
+
this list of conditions and the following disclaimer.
|
8
|
+
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY Thomas Sawyer ``AS IS'' AND ANY EXPRESS
|
14
|
+
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
15
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
16
|
+
NO EVENT SHALL Thomas Sawyer OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
17
|
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
18
|
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
19
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
20
|
+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
21
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
22
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23
|
+
|
24
|
+
(SPDX: BSD-2-Clause)
|
25
|
+
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,15 +1,15 @@
|
|
1
|
-
|
1
|
+
# Ruby Q.E.D.
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
[Homepage](http://rubyworks.github.com/qed) /
|
4
|
+
[Documentation](http://rubydoc.info/gems/qed/frames) /
|
5
|
+
[Report Issue](http://github.com/rubyworks/qed/issues) /
|
6
|
+
[Development](http://github.com/rubyworks/qed) /
|
7
|
+
[Mailing list](http://groups.google.com/group/rubyworks-mailinglist)
|
8
|
+
[](http://travis-ci.org/rubyworks/qed)
|
9
|
+
[](http://badge.fury.io/rb/qed)
|
8
10
|
|
9
|
-
{<img src="http://travis-ci.org/rubyworks/qed.png" />}[http://travis-ci.org/rubyworks/qed]
|
10
11
|
|
11
|
-
|
12
|
-
== Introduction
|
12
|
+
## Introduction
|
13
13
|
|
14
14
|
Q.E.D. is an abbreviation for the well known Latin phrase "Quod Erat Demonstrandum",
|
15
15
|
literally "which was to be demonstrated", which is oft written in its abbreviated
|
@@ -25,7 +25,7 @@ useful when designing reusable libraries, but it can be used to test code at
|
|
25
25
|
any level of abstraction, from unit test to systems tests.
|
26
26
|
|
27
27
|
|
28
|
-
|
28
|
+
## Features
|
29
29
|
|
30
30
|
* Write tests and documentation in the same breath!
|
31
31
|
* Demos can be RDoc, Markdown or any other conforming text format.
|
@@ -34,9 +34,9 @@ any level of abstraction, from unit test to systems tests.
|
|
34
34
|
* Documentation tool provides nice output with jQuery-based TOC.
|
35
35
|
|
36
36
|
|
37
|
-
|
37
|
+
## Synopsis
|
38
38
|
|
39
|
-
|
39
|
+
### Assertion Syntax
|
40
40
|
|
41
41
|
QED can use any BRASS compliant assertions framework. Simply require the library in
|
42
42
|
ones applique (see below). Traditionally this has been the AE (Assertive Expressive) library,
|
@@ -52,7 +52,7 @@ code blocks containing such assertions.
|
|
52
52
|
You can learn more about BRASS and AE at http://rubyworks.github.com/brass and
|
53
53
|
http://rubyworks.github.com/ae, repectively.
|
54
54
|
|
55
|
-
|
55
|
+
### Document Structure
|
56
56
|
|
57
57
|
QED documents are simply text files called *demonstrandum* (demos for short).
|
58
58
|
Because they largely consist of free-form descriptive text, they are a practice
|
@@ -81,7 +81,7 @@ Give this design some thought. It should become clear that this approach is
|
|
81
81
|
especially fruitful in that it allows *documentation* and *specification*
|
82
82
|
to seamlessly merge into a unified *demonstration*.
|
83
83
|
|
84
|
-
|
84
|
+
### Running Demonstrations
|
85
85
|
|
86
86
|
If we were to run the above document through QED in verbatim mode the output
|
87
87
|
would be identical (assuming we did not make a typo and the assertions passed).
|
@@ -91,33 +91,33 @@ To run a document through QED, simply use the +qed+ command.
|
|
91
91
|
|
92
92
|
$ qed -v demo/01_example.rdoc
|
93
93
|
|
94
|
-
The
|
94
|
+
The `-v` option specifies verbatim mode, which outputs the entire
|
95
95
|
document.
|
96
96
|
|
97
|
-
Notice we placed the QED document in a
|
98
|
-
no
|
99
|
-
|
100
|
-
|
101
|
-
|
97
|
+
Notice we placed the QED document in a `demo/` directory. This is the
|
98
|
+
canonical location, but there is no place that demonstrations have to go. They
|
99
|
+
can be placed anywhere that is preferred. However, the `qed` command
|
100
|
+
will look for `qed/`, `demo/`, `demos/` and `spec/`, in that order, if no
|
101
|
+
path is given.
|
102
102
|
|
103
|
-
Also notice the use of
|
104
|
-
While this is not strictly necessary,
|
105
|
-
in particular when generating QED documentation ("QEDocs").
|
103
|
+
Also notice the use of ``01_`` prefix in front of the file name.
|
104
|
+
While this is not strictly necessary, QED sorts the documents, so it helps order
|
105
|
+
the documents nicely, in particular when generating QED documentation ("QEDocs").
|
106
106
|
|
107
|
-
|
107
|
+
### Utilizing Applique
|
108
108
|
|
109
109
|
QED demonstrandum descriptive text is not strictly passive explanation. Using
|
110
110
|
pattern matching techniques, document phrases can trigger underlying actions.
|
111
111
|
These actions provide a support structure for running tests called the *applique*.
|
112
112
|
|
113
113
|
Creating an applique is easy. Along with your QED scripts, to which the
|
114
|
-
applique will apply, create an
|
114
|
+
applique will apply, create an `applique/` directory. In this
|
115
115
|
directory add Ruby scripts. When you run your demos every Ruby script in
|
116
116
|
the directory will be automatically loaded.
|
117
117
|
|
118
118
|
Within these applique scripts *advice* can be defined. Advice can be
|
119
119
|
either *event advice*, which is simply triggered by some fixed cycle
|
120
|
-
of running, such as
|
120
|
+
of running, such as `Before :each` or `After :all`,
|
121
121
|
and *pattern advice* which are used to match against descriptive
|
122
122
|
phrases in the QED demos. An example would be:
|
123
123
|
|
@@ -132,23 +132,21 @@ It is rather amazing what can be accomplished with such a system,
|
|
132
132
|
be sure to look at QED's own demonstrandum to get a better notion of
|
133
133
|
how you can put the the system to use.
|
134
134
|
|
135
|
-
|
136
|
-
|
137
|
-
QED uses the {RC}[http://rubyworks.github.com/rc] library to
|
138
|
-
handle configuration.
|
135
|
+
### Configuration
|
139
136
|
|
140
|
-
|
141
|
-
|
142
|
-
|
137
|
+
Configuration for `qed` can be placed in a `etc/qed.rb` file, or if
|
138
|
+
you are using Rails, in `config/qed.rb`. Here's a generally useful
|
139
|
+
example of using SimpleCov to generate a test coverage report when
|
140
|
+
running your QED demos.
|
143
141
|
|
144
|
-
|
142
|
+
QED.configure 'coverage' do
|
145
143
|
require 'simplecov'
|
146
144
|
SimpleCov.start do
|
147
145
|
coverage_dir 'log/coverage'
|
148
146
|
end
|
149
147
|
end
|
150
148
|
|
151
|
-
You can use the profile via the `-p/--profile` option on the command line:
|
149
|
+
You can then use the profile via the `-p/--profile` option on the command line:
|
152
150
|
|
153
151
|
$ qed -p coverage
|
154
152
|
|
@@ -156,42 +154,53 @@ Or by setting the `profile` environment variable.
|
|
156
154
|
|
157
155
|
$ profile=coverage qed
|
158
156
|
|
159
|
-
|
157
|
+
QED can also use the [RC](http://rubyworks.github.com/rc) gem to handle
|
158
|
+
configuration. Be sure to `gem install rc` and then add this to `.rubyrc`
|
159
|
+
or `Config.rb` file of the same effect as given above.
|
160
|
+
|
161
|
+
config :qed, :profile=>:coverage do
|
162
|
+
require 'simplecov'
|
163
|
+
SimpleCov.start do
|
164
|
+
coverage_dir 'log/coverage'
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
### Generating Documentation
|
160
169
|
|
161
170
|
To generate documentation from QED documents, use the +qedoc+ command.
|
162
171
|
|
163
172
|
$ qedoc --output doc/qedoc --title "Example" demo/*.rdoc
|
164
173
|
|
165
174
|
When documenting, QED recognizes the format by the file extension and
|
166
|
-
treats it accordingly. An extension of
|
167
|
-
as
|
175
|
+
treats it accordingly. An extension of `.qed` is treated the same
|
176
|
+
as `.rdoc`.
|
168
177
|
|
169
|
-
Use the
|
178
|
+
Use the `--help` options on each command to get more information
|
170
179
|
on the use of these commands.
|
171
180
|
|
172
181
|
|
173
|
-
|
182
|
+
## Requirements
|
174
183
|
|
175
184
|
QED depends on the following external libraries:
|
176
185
|
|
177
|
-
*
|
178
|
-
*
|
179
|
-
*
|
180
|
-
*
|
186
|
+
* [BRASS](http://rubyworks.github.com/brass) - Assertions System
|
187
|
+
* [ANSI](http://rubyworks.github.com/ansi) - ANSI Color Codes
|
188
|
+
* [RC](http://rubyworks.github.com/rc) - Runtime Configuration
|
189
|
+
* [Facets](http://rubyworks.github.com/facets) - Core Extensions
|
181
190
|
|
182
191
|
These will be automatically installed when installing QED via RubyGems,
|
183
192
|
if they are not already installed.
|
184
193
|
|
185
194
|
Optional libraries that are generally useful with QED.
|
186
195
|
|
187
|
-
*
|
196
|
+
* [AE](http://rubyworks.github.com/ae) - Assertions Framework
|
188
197
|
|
189
198
|
Install these individually and require them in your applique to use.
|
190
199
|
|
191
200
|
|
192
|
-
|
201
|
+
## Development
|
193
202
|
|
194
|
-
|
203
|
+
### Testing
|
195
204
|
|
196
205
|
QED uses itself for testing, which can be a bit tricky. But works fine for
|
197
206
|
the most part. In the future we may add some addition tests via another
|
@@ -204,11 +213,11 @@ For convenience, use `$ fire spec` to run the test specifications. To also
|
|
204
213
|
generate a test coverage report use `$ fire spec:cov`.
|
205
214
|
|
206
215
|
|
207
|
-
|
216
|
+
## Copyrights
|
208
217
|
|
209
|
-
(BSD
|
218
|
+
(BSD-2-Clause license)
|
210
219
|
|
211
|
-
Copyright (c) 2009 Rubyworks
|
220
|
+
Copyright (c) 2009 Rubyworks. All rights reserved.
|
212
221
|
|
213
|
-
See
|
222
|
+
See LICENSE.txt for details.
|
214
223
|
|