qed 2.7.0 → 2.8.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/.ruby CHANGED
@@ -14,13 +14,16 @@ requirements:
14
14
  - name: ansi
15
15
  - name: facets
16
16
  version: 2.8+
17
- - name: ae
18
- version: 1.7+
17
+ - name: brass
19
18
  - name: confection
20
19
  - name: detroit
21
20
  groups:
22
21
  - build
23
22
  development: true
23
+ - name: ae
24
+ groups:
25
+ - test
26
+ development: true
24
27
  dependencies: []
25
28
  conflicts: []
26
29
  repositories:
@@ -36,12 +39,13 @@ extra: {}
36
39
  load_path:
37
40
  - lib
38
41
  revision: 0
39
- created: '2006-12-16'
42
+ created: '2009-06-16'
40
43
  summary: Quod Erat Demonstrandum
41
44
  title: QED
42
- version: 2.7.0
45
+ version: 2.8.0
46
+ scm_uri: http://github.com/rubyworks/qed/blob/master/
43
47
  name: qed
44
48
  description: ! 'QED (Quality Ensured Demonstrations) is a TDD/BDD framework
45
49
 
46
50
  utilizing Literate Programming techniques.'
47
- date: '2011-11-20'
51
+ date: '2012-01-25'
@@ -1,5 +1,24 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 2.8.0 | 2012-01-19
4
+
5
+ IMPORTANT: READ THIS RELEASE NOTICE! This release makes a minor
6
+ change, but it is one that will effect all end-users. That is, QED no
7
+ longer depends on AE as its one and only assertion framework. Instead
8
+ any compliant framework can be used. Certainly most users will be happy
9
+ to continue using AE, in which case simply add `require 'ae'` to your
10
+ applique (e.g. in 'spec/applique/ae.rb') or add `-r ae` to the qed command
11
+ line invocation to ensure demos continue running as before. In place of
12
+ AE the _BRASS_ gem now provides basic assertion support. Any assertion
13
+ framework that complies with the simple BRASS standards will work with QED.
14
+
15
+ Changes:
16
+
17
+ * No longer depend only on AE for assertion framework.
18
+ * Rename $assertion_counts to $ASSERTION_COUNTS.
19
+ * Complies with assertion standards set by BRASS project.
20
+
21
+
3
22
  == 2.7.0 | 2011-11-18
4
23
 
5
24
  The focus of this release is a much improved underlying API, including
@@ -1,8 +1,10 @@
1
1
  = Ruby Q.E.D.
2
2
 
3
3
  {Homepage}[http://rubyworks.github.com/qed] |
4
+ {Documentation}[http://rubydoc.info/gems/qed/frames] |
5
+ {Report Issue}[http://github.com/rubyworks/qed/issues] |
4
6
  {Development}[http://github.com/rubyworks/qed] |
5
- {Mailing list}[http://groups.google.com/group/rubyworks-mailinglist] |
7
+ {Mailing list}[http://groups.google.com/group/rubyworks-mailinglist]
6
8
 
7
9
  {<img src="http://travis-ci.org/rubyworks/qed.png" />}[http://travis-ci.org/rubyworks/qed]
8
10
 
@@ -154,7 +156,7 @@ if they are not already installed.
154
156
 
155
157
  Q.E.D.
156
158
 
157
- Copyright (c) 2007 Rubyworks, Thomas Sawyer
159
+ Copyright (c) 2009 Rubyworks, Thomas Sawyer
158
160
 
159
161
  BSD 2 Clause License
160
162
 
@@ -14,13 +14,16 @@ requirements:
14
14
  - name: ansi
15
15
  - name: facets
16
16
  version: 2.8+
17
- - name: ae
18
- version: 1.7+
17
+ - name: brass
19
18
  - name: confection
20
19
  - name: detroit
21
20
  groups:
22
21
  - build
23
22
  development: true
23
+ - name: ae
24
+ groups:
25
+ - test
26
+ development: true
24
27
  dependencies: []
25
28
  conflicts: []
26
29
  repositories:
@@ -36,12 +39,13 @@ extra: {}
36
39
  load_path:
37
40
  - lib
38
41
  revision: 0
39
- created: '2006-12-16'
42
+ created: '2009-06-16'
40
43
  summary: Quod Erat Demonstrandum
41
44
  title: QED
42
- version: 2.7.0
45
+ version: 2.8.0
46
+ scm_uri: http://github.com/rubyworks/qed/blob/master/
43
47
  name: qed
44
48
  description: ! 'QED (Quality Ensured Demonstrations) is a TDD/BDD framework
45
49
 
46
50
  utilizing Literate Programming techniques.'
47
- date: '2011-11-20'
51
+ date: '2012-01-25'
@@ -1,3 +1,5 @@
1
+ require 'brass'
2
+
1
3
  require 'facets/dir/ascend'
2
4
 
3
5
  class Object
@@ -36,3 +38,4 @@ class Object
36
38
  end
37
39
 
38
40
  end
41
+
@@ -58,7 +58,9 @@ module QED
58
58
  @applique ||= (
59
59
  list = [Applique.new]
60
60
  applique_locations.each do |location|
61
- Dir[location + '/**/*'].each do |file|
61
+ #Dir[location + '/**/*'].each do |file|
62
+ Dir[location + '/*'].each do |file|
63
+ next if File.directory?(file)
62
64
  list << Applique.for(file)
63
65
  end
64
66
  end
@@ -236,8 +236,8 @@ module Reporter
236
236
 
237
237
  #
238
238
  def get_tally
239
- assert_count = AE::Assertor.counts[:total]
240
- assert_fails = AE::Assertor.counts[:fail]
239
+ assert_count = $ASSERTION_COUNTS[:total]
240
+ assert_fails = $ASSERTION_COUNTS[:fail]
241
241
  assert_delta = assert_count - assert_fails
242
242
 
243
243
  vars = [demos.size, steps.size, fails.size, errors.size, assert_delta, assert_count] #, @pass.size ]
@@ -1,7 +1,7 @@
1
- require 'ae'
2
-
3
1
  module QED
4
2
 
3
+ #require 'ae'
4
+
5
5
  # Scope is the context in which QED documents are run.
6
6
  #
7
7
  class Scope < Module
@@ -121,6 +121,8 @@ module QED
121
121
 
122
122
  clear_directory
123
123
 
124
+ reset_assertion_counts
125
+
124
126
  prepare_loadpath
125
127
  require_libraries
126
128
 
@@ -146,11 +148,16 @@ module QED
146
148
  reporter.success?
147
149
  end
148
150
 
149
- #
151
+ # Clear temporary testing directory.
150
152
  def clear_directory
151
153
  settings.clear_directory
152
154
  end
153
155
 
156
+ # Set $ASSERTION_COUNTS to zero point.
157
+ def reset_assertion_counts
158
+ $ASSERTION_COUNTS = Hash.new{|h,k| h[k] = 0 }
159
+ end
160
+
154
161
  # Add to load path (from -I option).
155
162
  def prepare_loadpath
156
163
  loadpath.each{ |dir| $LOAD_PATH.unshift(File.expand_path(dir)) }
@@ -227,8 +227,10 @@ module QED
227
227
  #
228
228
  def tweak_code
229
229
  code = @example_lines.map{ |lineno, line| line }.join("")
230
- code.gsub!(/\n\s*\#\ ?\=\>/, '.assert = ')
231
- code.gsub!(/\s*\#\ ?\=\>/, '.assert = ')
230
+ #code.gsub!(/\n\s*\#\ ?\=\>/, '.assert = ')
231
+ #code.gsub!(/\s*\#\ ?\=\>/, '.assert = ')
232
+ code.gsub!(/\n\s*\#\ ?\=\>(.*?)$/, ' == \1 ? assert(true) : assert(false, "not returned -- \1")') # TODO: what kind of error ?
233
+ code.gsub!(/\s*\#\ ?\=\>(.*?)$/, ' == \1 ? assert(true) : assert(false, "not returned -- \1")')
232
234
  code
233
235
  end
234
236
 
@@ -1,4 +1,4 @@
1
- = Demonstrations
1
+ = QED Demonstrandum
2
2
 
3
3
  == Steps
4
4
 
@@ -86,11 +86,10 @@ an object just magically appear.
86
86
  == Event Targets
87
87
 
88
88
  There is a small set of advice targets that do not come before or after,
89
- rather they occur *upon* a particular event. These include +:load+
90
- and +:unload+ for when a new helper is loaded; +:pass+, +:fail+ and +:error+
91
- for when a code block passes, fails or raises an error; and +:head+, +:desc:+,
92
- +:code+ and +:data:+ which targets the immediate processing of a text block
93
- and code excecution.
89
+ rather they occur *upon* a particular event. These include +:pass+, +:fail+
90
+ and +:error+ for when a code block passes, fails or raises an error; and
91
+ +:step+, +:applique+, +:match+ and +:test:+ which targets the processing
92
+ of a demo step and it's example excecution.
94
93
 
95
94
  These event targets can be advised by calling the +When+ method
96
95
  with the target type as an argument along with the code block
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qed
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-21 00:00:00.000000000 Z
12
+ date: 2012-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ansi
16
- requirement: &70171077943540 !ruby/object:Gem::Requirement
16
+ requirement: &25621900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70171077943540
24
+ version_requirements: *25621900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: facets
27
- requirement: &70171077942820 !ruby/object:Gem::Requirement
27
+ requirement: &25620880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: '2.8'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70171077942820
35
+ version_requirements: *25620880
36
36
  - !ruby/object:Gem::Dependency
37
- name: ae
38
- requirement: &70171077942200 !ruby/object:Gem::Requirement
37
+ name: brass
38
+ requirement: &25620240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
- version: '1.7'
43
+ version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70171077942200
46
+ version_requirements: *25620240
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: confection
49
- requirement: &70171077941740 !ruby/object:Gem::Requirement
49
+ requirement: &25619480 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,21 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70171077941740
57
+ version_requirements: *25619480
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: detroit
60
- requirement: &70171077941200 !ruby/object:Gem::Requirement
60
+ requirement: &25618820 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *25618820
69
+ - !ruby/object:Gem::Dependency
70
+ name: ae
71
+ requirement: &25616480 !ruby/object:Gem::Requirement
61
72
  none: false
62
73
  requirements:
63
74
  - - ! '>='
@@ -65,7 +76,7 @@ dependencies:
65
76
  version: '0'
66
77
  type: :development
67
78
  prerelease: false
68
- version_requirements: *70171077941200
79
+ version_requirements: *25616480
69
80
  description: ! 'QED (Quality Ensured Demonstrations) is a TDD/BDD framework
70
81
 
71
82
  utilizing Literate Programming techniques.'