qed 2.6.1 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby CHANGED
@@ -1,48 +1,46 @@
1
- ---
2
- name: qed
3
- version: 2.6.1
4
- title: QED
5
- summary: Quod Erat Demonstrandum
6
- description: QED (Quality Ensured Demonstrations) is a TDD/BDD framework utilizing Literate Programming techniques.
7
- loadpath:
8
- - lib
9
- manifest: MANIFEST
10
- requires:
1
+ ---
2
+ source:
3
+ - meta/
4
+ authors:
5
+ - name: Trans
6
+ email: transfire@gmail.com
7
+ copyrights:
8
+ - holder: Thomas Sawyer, Rubyworks
9
+ year: '2006'
10
+ license: BSD-2-Clause
11
+ replacements: []
12
+ alternatives: []
13
+ requirements:
11
14
  - name: ansi
12
- version: 0+
13
- group: []
14
-
15
15
  - name: facets
16
16
  version: 2.8+
17
- group: []
18
-
19
17
  - name: ae
20
18
  version: 1.7+
21
- group: []
22
-
23
19
  - name: detroit
24
- version: 0+
25
- group:
20
+ groups:
26
21
  - build
22
+ development: true
23
+ dependencies: []
27
24
  conflicts: []
28
-
29
- replaces: []
30
-
31
- engine_check: []
32
-
33
- organization: RubyWorks
34
- contact: trans <transfire@gmail.com>
35
- created: 2006-12-16
36
- copyright: Copyright (c) 2006 Thomas Sawyer
37
- licenses: []
38
-
39
- authors:
40
- - Thomas Sawyer <transfire@gmail.com>
41
- maintainers: []
42
-
43
- resources:
25
+ repositories:
26
+ - uri: git://github.com/rubyworks/qed.git
27
+ scm: git
28
+ name: upstream
29
+ resources:
44
30
  home: http://rubyworks.github.com/qed
45
- work: http://github.com/rubyworks/qed
46
- repositories:
47
- public: git://github.com/rubyworks/qed.git
48
- spec_version: 1.0.0
31
+ code: http://github.com/rubyworks/qed
32
+ mail: http://groups.google.com/groups/rubyworks-mailinglist
33
+ bugs: http://github.com/rubyworks/qed/issues
34
+ extra: {}
35
+ load_path:
36
+ - lib
37
+ revision: 0
38
+ created: '2006-12-16'
39
+ summary: Quod Erat Demonstrandum
40
+ title: QED
41
+ version: 2.6.2
42
+ name: qed
43
+ description: ! 'QED (Quality Ensured Demonstrations) is a TDD/BDD framework
44
+
45
+ utilizing Literate Programming techniques.'
46
+ date: '2011-10-24'
@@ -1,10 +1,23 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 2.6.2 / 2011-10-23
4
+
5
+ Fixed output status. When tests fail or error the `qed`
6
+ command with exit -1 instead to 0. Also, the default
7
+ spec location uses only one of `qed`, `demo` or `spec`
8
+ instead of all.
9
+
10
+ Changes:
11
+
12
+ * Fix output status, exit -1 on test failure or error.
13
+ * Fix default spec location to only use one or the other.
14
+
15
+
3
16
  == 2.6.1 / 2011-07-02
4
17
 
5
- A friend insisted QED default the loadpath tolib and
18
+ A friend suggested QED default the load path to lib and
6
19
  automatically look for QED demos in default locations
7
- (sepc, demo, qed) if not files are passed to it on the
20
+ (qed, demo, spec) if no files are passed to it on the
8
21
  command line. So it is.
9
22
 
10
23
  Changes:
@@ -1,12 +1,12 @@
1
1
  = COPYRIGHT NOTICES
2
2
 
3
- == YES
3
+ == QED
4
4
 
5
- Copyright:: (c) 2011 Rubyworks, Thomas Sawyer
5
+ Copyright:: (c) 2007 Rubyworks, Thomas Sawyer
6
6
  License:: BSD-2-Clause
7
7
  Website:: http://rubyworks.github.com/yes
8
8
 
9
- Copyright 2011 Thomas Sawyer. All rights reserved.
9
+ Copyright 2007 Thomas Sawyer, Rubyworks. All rights reserved.
10
10
 
11
11
  Redistribution and use in source and binary forms, with or without
12
12
  modification, are permitted provided that the following conditions are met:
@@ -29,7 +29,3 @@ Website:: http://rubyworks.github.com/yes
29
29
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30
30
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
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
-
@@ -157,6 +157,6 @@ Q.E.D.
157
157
 
158
158
  Copyright (c) 2007 Thomas Sawyer
159
159
 
160
- BSD 2-Clause License
160
+ BSD 2 Clause License
161
161
 
162
162
  See LICENSE.rdoc for details.
@@ -452,3 +452,5 @@ A constant defined in the applique is visible.
452
452
  APPLIQUE_CONSTANT.assert = true
453
453
 
454
454
 
455
+
456
+
@@ -1,48 +1,46 @@
1
- ---
2
- name: qed
3
- version: 2.6.1
4
- title: QED
5
- summary: Quod Erat Demonstrandum
6
- description: QED (Quality Ensured Demonstrations) is a TDD/BDD framework utilizing Literate Programming techniques.
7
- loadpath:
8
- - lib
9
- manifest: MANIFEST
10
- requires:
1
+ ---
2
+ source:
3
+ - meta/
4
+ authors:
5
+ - name: Trans
6
+ email: transfire@gmail.com
7
+ copyrights:
8
+ - holder: Thomas Sawyer, Rubyworks
9
+ year: '2006'
10
+ license: BSD-2-Clause
11
+ replacements: []
12
+ alternatives: []
13
+ requirements:
11
14
  - name: ansi
12
- version: 0+
13
- group: []
14
-
15
15
  - name: facets
16
16
  version: 2.8+
17
- group: []
18
-
19
17
  - name: ae
20
18
  version: 1.7+
21
- group: []
22
-
23
19
  - name: detroit
24
- version: 0+
25
- group:
20
+ groups:
26
21
  - build
22
+ development: true
23
+ dependencies: []
27
24
  conflicts: []
28
-
29
- replaces: []
30
-
31
- engine_check: []
32
-
33
- organization: RubyWorks
34
- contact: trans <transfire@gmail.com>
35
- created: 2006-12-16
36
- copyright: Copyright (c) 2006 Thomas Sawyer
37
- licenses: []
38
-
39
- authors:
40
- - Thomas Sawyer <transfire@gmail.com>
41
- maintainers: []
42
-
43
- resources:
25
+ repositories:
26
+ - uri: git://github.com/rubyworks/qed.git
27
+ scm: git
28
+ name: upstream
29
+ resources:
44
30
  home: http://rubyworks.github.com/qed
45
- work: http://github.com/rubyworks/qed
46
- repositories:
47
- public: git://github.com/rubyworks/qed.git
48
- spec_version: 1.0.0
31
+ code: http://github.com/rubyworks/qed
32
+ mail: http://groups.google.com/groups/rubyworks-mailinglist
33
+ bugs: http://github.com/rubyworks/qed/issues
34
+ extra: {}
35
+ load_path:
36
+ - lib
37
+ revision: 0
38
+ created: '2006-12-16'
39
+ summary: Quod Erat Demonstrandum
40
+ title: QED
41
+ version: 2.6.2
42
+ name: qed
43
+ description: ! 'QED (Quality Ensured Demonstrations) is a TDD/BDD framework
44
+
45
+ utilizing Literate Programming techniques.'
46
+ date: '2011-10-24'
@@ -27,11 +27,11 @@ module QED
27
27
  # Ouput file.
28
28
  attr_accessor :output
29
29
 
30
- # Either html or plain.
30
+ # Format of output file, either 'html' or 'plain'.
31
31
  # Defaults to extension of output file.
32
32
  attr_accessor :format
33
33
 
34
- #
34
+ # Files to document.
35
35
  attr_reader :paths
36
36
 
37
37
  #
@@ -88,6 +88,10 @@ module QED
88
88
  end
89
89
 
90
90
  # Generate specification document.
91
+ #
92
+ #--
93
+ # TODO: Use Malt to support more formats in future.
94
+ #++
91
95
  def generate
92
96
  #copy_support_files
93
97
 
@@ -101,9 +105,11 @@ module QED
101
105
 
102
106
  #TODO: load .config/qedrc.rb
103
107
 
104
- demo_files.each do |file|
105
- puts file unless quiet?
108
+ if dryrun or $DEBUG
109
+ puts demo_files.sort.join(" ")
110
+ end
106
111
 
112
+ demo_files.each do |file|
107
113
  #strio = StringIO.new('')
108
114
  #reporter = Reporter::Html.new(strio)
109
115
  #runner = Runner.new([file], reporter)
@@ -152,7 +158,7 @@ module QED
152
158
  end
153
159
 
154
160
  if html?
155
- temp = Template.new(template, output, title, css)
161
+ temp = Template.new(template, out, title, css)
156
162
  html = temp.parse_template
157
163
  save(html)
158
164
  else
@@ -185,12 +191,13 @@ module QED
185
191
  # Save specification document.
186
192
  def save(text)
187
193
  if dryrun
188
- puts "\nwrite #{output}"
194
+ puts "[dry-run] Write #{output}" unless quiet
189
195
  else
190
196
  make_output_directory
191
197
  File.open(output, 'wb') do |f|
192
198
  f << text
193
199
  end
200
+ puts "Write #{output}" unless quiet
194
201
  end
195
202
  end
196
203
 
@@ -117,7 +117,8 @@
117
117
  <!-- Side Table of Contents -->
118
118
  <div id="sidebar" style="position: fixed; top: 10; right: 10; background: white;">
119
119
  <a href="javascript: toc_toggle();">
120
- <img src="http://www.cdnjs.com/images/poweredbycloudflare.png" style="border: none;" alt="TOC" align="right"/>
120
+ <!-- TODO: find a preminatn image on web to use -->
121
+ <!-- <img src="http://www.cdnjs.com/images/poweredbycloudflare.png" style="border: none;" alt="TOC" align="right"/> -->
121
122
  </a>
122
123
 
123
124
  <div id="toc_side" class="toc">
@@ -126,7 +127,8 @@
126
127
 
127
128
  <div id="container">
128
129
  <div id="header">
129
- <img src="http://www.cdnjs.com/images/poweredbycloudflare.png" align="left" style="padding-right: 10px;" alt=""/>
130
+ <!-- TODO: find a preminatn image on web to use -->
131
+ <!-- <img src="http://www.cdnjs.com/images/poweredbycloudflare.png" align="left" style="padding-right: 10px;" alt=""/> -->
130
132
 
131
133
  <div class="title"><%= title %></div>
132
134
 
@@ -56,6 +56,11 @@ module Reporter
56
56
  @trace
57
57
  end
58
58
 
59
+ #
60
+ def success?
61
+ record[:error] + record[:fail] == 0
62
+ end
63
+
59
64
  #
60
65
  def update(type, *args)
61
66
  __send__("count_#{type}", *args) if respond_to?("count_#{type}")
@@ -271,7 +276,11 @@ module Reporter
271
276
 
272
277
  #
273
278
  def clean_backtrace(*btrace)
274
- stack = btrace.reject{ |bt| bt =~ INTERNALS } unless $DEBUG
279
+ stack = if $DEBUG
280
+ btrace
281
+ else
282
+ btrace.reject{ |bt| bt =~ INTERNALS }
283
+ end
275
284
  stack.map do |bt|
276
285
  bt.chomp(":in \`__binding__'")
277
286
  end
@@ -306,6 +315,7 @@ module Reporter
306
315
  file, lineno = file_and_line(exception)
307
316
 
308
317
  return nil if file.empty?
318
+ return nil if file == '(eval)'
309
319
 
310
320
  source = source(file)
311
321
 
@@ -356,7 +366,11 @@ module Reporter
356
366
  # @return [String] source code
357
367
  def source(file)
358
368
  @source[file] ||= (
359
- File.readlines(file)
369
+ if File.exist?(file)
370
+ File.readlines(file)
371
+ else
372
+ ''
373
+ end
360
374
  )
361
375
  end
362
376
 
@@ -63,11 +63,16 @@ module QED
63
63
 
64
64
  # Evaluate code in the context of the scope's special binding.
65
65
  # The return result of the evaluation is stored in `@_`.
66
+ #
67
+ # TODO: rename to avoid conflict with Kernel method.
66
68
  def eval(code, file=nil, line=nil)
67
- @_ = super(code, __binding__, @_file, line)
69
+ if file
70
+ @_ = super(code, __binding__, file.to_s, line.to_i)
71
+ else
72
+ @_ = super(code, __binding__)
73
+ end
68
74
  end
69
75
 
70
-
71
76
  # Utilize is like #require, but will evaluate the script in the context
72
77
  # of the current scope.
73
78
  #--
@@ -9,9 +9,9 @@ module QED
9
9
  #
10
10
  class Session
11
11
 
12
- # If files are not specifies than these directories
12
+ # If files are not specified than these directories
13
13
  # will be searched.
14
- DEFAULT_FILES = ['spec', 'demo', 'qed']
14
+ DEFAULT_FILES = ['qed', 'demo', 'spec']
15
15
 
16
16
  # Default recognized demos file types.
17
17
  DEMO_TYPES = %w{qed rdoc md markdown}
@@ -56,8 +56,8 @@ module QED
56
56
  def initialize(files, options={})
57
57
  require_reporters
58
58
 
59
- @files = [files].flatten
60
- @files = DEFAULT_FILES if @files.empty?
59
+ @files = [files].flatten.compact
60
+ @files = [DEFAULT_FILES.find{ |d| File.directory?(d) }] if @files.empty?
61
61
 
62
62
  @format = options[:format] || :dotprogress
63
63
  @trace = options[:trace] || false
@@ -82,6 +82,8 @@ module QED
82
82
  #end
83
83
 
84
84
  # TODO: Ultimately use Plugin library to support custom reporters?
85
+
86
+ # Require all reporters.
85
87
  def require_reporters
86
88
  Dir[File.dirname(__FILE__) + '/reporter/*'].each do |file|
87
89
  require file
@@ -140,6 +142,8 @@ module QED
140
142
  reporter.after_session(self)
141
143
  #profile.after_session(self)
142
144
  end
145
+
146
+ reporter.success?
143
147
  end
144
148
 
145
149
  #
@@ -149,7 +153,7 @@ module QED
149
153
 
150
154
  # Add to load path (from -I option).
151
155
  def prepare_loadpath
152
- loadpath.each{ |dir| $LOAD_PATH.unshift(dir) }
156
+ loadpath.each{ |dir| $LOAD_PATH.unshift(File.expand_path(dir)) }
153
157
  end
154
158
 
155
159
  # Require libraries (from -r option).
@@ -235,7 +239,8 @@ module QED
235
239
  #end
236
240
 
237
241
  session = new(files, options)
238
- session.run
242
+ success = session.run
243
+ exit -1 unless success
239
244
  end
240
245
 
241
246
  # Instance of OptionParser
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,71 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: qed
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.6.2
4
5
  prerelease:
5
- version: 2.6.1
6
6
  platform: ruby
7
- authors:
8
- - Thomas Sawyer <transfire@gmail.com>
7
+ authors:
8
+ - Trans
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-07-02 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-10-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: ansi
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &31390400 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: facets
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *31390400
25
+ - !ruby/object:Gem::Dependency
26
+ name: facets
27
+ requirement: &31389700 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "2.8"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '2.8'
35
33
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: ae
39
34
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *31389700
36
+ - !ruby/object:Gem::Dependency
37
+ name: ae
38
+ requirement: &31389100 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "1.7"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '1.7'
46
44
  type: :runtime
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: detroit
50
45
  prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *31389100
47
+ - !ruby/object:Gem::Dependency
48
+ name: detroit
49
+ requirement: &31388600 !ruby/object:Gem::Requirement
52
50
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
57
55
  type: :development
58
- version_requirements: *id004
59
- description: QED (Quality Ensured Demonstrations) is a TDD/BDD framework utilizing Literate Programming techniques.
60
- email: transfire@gmail.com
61
- executables:
56
+ prerelease: false
57
+ version_requirements: *31388600
58
+ description: ! 'QED (Quality Ensured Demonstrations) is a TDD/BDD framework
59
+
60
+ utilizing Literate Programming techniques.'
61
+ email:
62
+ - transfire@gmail.com
63
+ executables:
62
64
  - qedoc
63
65
  - qed
64
66
  extensions: []
65
-
66
- extra_rdoc_files:
67
+ extra_rdoc_files:
68
+ - HISTORY.rdoc
69
+ - SPECSHEET.rdoc
67
70
  - README.rdoc
68
- files:
71
+ - LICENSE.rdoc
72
+ files:
69
73
  - .ruby
70
74
  - .yardopts
71
75
  - bin/qed
@@ -96,60 +100,54 @@ files:
96
100
  - lib/qed.rb
97
101
  - lib/qed.yml
98
102
  - lib/yard-qed.rb
99
- - qed/01_demos.rdoc
100
- - qed/02_advice.rdoc
101
- - qed/03_helpers.rdoc
102
- - qed/04_samples.rdoc
103
- - qed/05_quote.rdoc
104
- - qed/07_toplevel.rdoc
105
- - qed/08_cross_script.rdoc
106
- - qed/09_cross_script.rdoc
107
- - qed/10_constant_lookup.rdoc
108
- - qed/applique/constant.rb
109
- - qed/applique/env.rb
110
- - qed/applique/fileutils.rb
111
- - qed/applique/markup.rb
112
- - qed/applique/quote.rb
113
- - qed/applique/toplevel.rb
114
- - qed/helpers/advice.rb
115
- - qed/helpers/sample.rb
116
- - qed/helpers/toplevel.rb
117
- - qed/samples/data.txt
118
- - qed/samples/table.yml
103
+ - spec/01_demos.rdoc
104
+ - spec/02_advice.rdoc
105
+ - spec/03_helpers.rdoc
106
+ - spec/04_samples.rdoc
107
+ - spec/05_quote.rdoc
108
+ - spec/07_toplevel.rdoc
109
+ - spec/08_cross_script.rdoc
110
+ - spec/09_cross_script.rdoc
111
+ - spec/10_constant_lookup.rdoc
112
+ - spec/applique/constant.rb
113
+ - spec/applique/env.rb
114
+ - spec/applique/fileutils.rb
115
+ - spec/applique/markup.rb
116
+ - spec/applique/quote.rb
117
+ - spec/applique/toplevel.rb
118
+ - spec/helpers/advice.rb
119
+ - spec/helpers/sample.rb
120
+ - spec/helpers/toplevel.rb
121
+ - spec/samples/data.txt
122
+ - spec/samples/table.yml
119
123
  - test/integration/topcode.rdoc
120
124
  - HISTORY.rdoc
125
+ - SPECSHEET.rdoc
121
126
  - README.rdoc
122
- - QED.rdoc
123
127
  - LICENSE.rdoc
124
128
  homepage: http://rubyworks.github.com/qed
125
- licenses: []
126
-
129
+ licenses:
130
+ - BSD-2-Clause
127
131
  post_install_message:
128
- rdoc_options:
129
- - --title
130
- - QED API
131
- - --main
132
- - README.rdoc
133
- require_paths:
132
+ rdoc_options: []
133
+ require_paths:
134
134
  - lib
135
- required_ruby_version: !ruby/object:Gem::Requirement
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
136
  none: false
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- version: "0"
141
- required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ! '>='
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  none: false
143
- requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: "0"
143
+ requirements:
144
+ - - ! '>='
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
147
  requirements: []
148
-
149
- rubyforge_project: qed
150
- rubygems_version: 1.8.2
148
+ rubyforge_project:
149
+ rubygems_version: 1.8.10
151
150
  signing_key:
152
151
  specification_version: 3
153
152
  summary: Quod Erat Demonstrandum
154
153
  test_files: []
155
-