tapout 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby CHANGED
@@ -29,18 +29,17 @@ resources:
29
29
  code: http://github.com/rubyworks/tapout
30
30
  load_path:
31
31
  - lib
32
- extra:
33
- manifest: MANIFEST
32
+ extra: {}
34
33
  source:
35
34
  - PROFILE
36
35
  alternatives: []
37
36
  revision: 0
38
37
  name: tapout
39
38
  title: TapOut
40
- version: 0.3.0
39
+ version: 0.3.1
41
40
  summary: Progressive TAP Harness
42
41
  description: Tapout is a TAP consumer that can take any TAP, TAP-Y or TAP-J stream
43
42
  and output it in a variety of useful formats.
44
43
  organization: RubyWorks
45
44
  created: '2010-12-23'
46
- date: '2011-10-08'
45
+ date: '2011-10-18'
data/HISTORY.rdoc CHANGED
@@ -1,5 +1,16 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 0.3.1 / 2011-10-18
4
+
5
+ This release fixes an error raised when no report format is explicitly specified.
6
+ Where as it is supposed to default to the `dot` reporter. It also adds initial
7
+ support for error/failure `class` field.
8
+
9
+ Changes:
10
+
11
+ * Fix default reporter issue. (Brad Murray) #1
12
+ * Add support for class field to Turn reporter.
13
+
3
14
 
4
15
  == 0.3.0 / 2011-10-09
5
16
 
@@ -8,8 +19,13 @@ to the document types. The `final` document is the last document of a test suite
8
19
  It takes the place of `tally`, which is now simply an optional running subtotal
9
20
  document.
10
21
 
11
- This release also makes some intreface imporvements to the `Reporters::Abstract`
12
- base class and ports over all applicable reporters from othe Turn project.
22
+ This release also makes some interface improvements to the `Reporters::Abstract`
23
+ base class and ports over all applicable reporters from the Turn project.
24
+
25
+ Changes:
26
+
27
+ * Use `final` instead of `tally` for last entry.
28
+ * Port Turn report formats.
13
29
 
14
30
 
15
31
  == 0.2.3 / 2011-10-08
@@ -29,7 +45,7 @@ Fixed incorrect tally entry in breakdown reporter.
29
45
  Changes:
30
46
 
31
47
  * Fixed incorrect tally entry in breakdown reporter.
32
- * Add intergration specs for reporters.
48
+ * Add integration specs for reporters.
33
49
 
34
50
 
35
51
  == 0.2.1 / 2011-10-06
@@ -45,11 +61,11 @@ Changes:
45
61
 
46
62
  == 0.2.0 / 2011-10-06
47
63
 
48
- This realease revises the specification a bit, primarily
64
+ This release revises the specification a bit, primarily
49
65
  changing the names of header and footer sections to more
50
- semantically usefule terms, suite and tally, respectively.
66
+ semantically useful terms, suite and tally, respectively.
51
67
  Also, a `rev` field has been added to the suite entries
52
- to allow consuming apps to gracfully handle any future
68
+ to allow consuming apps to gracefully handle any future
53
69
  changes.
54
70
 
55
71
  Changes:
data/PROFILE CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tapout
3
- version: 0.3.0
3
+ version: 0.3.1
4
4
 
5
5
  title: TapOut
6
6
  summary: Progressive TAP Harness
data/TAP-YJ.md CHANGED
@@ -122,10 +122,10 @@ equality, e.g. <code>assert_equal(4,3)</code>, so `expected` would be `3` and
122
122
  of information for a test framework to provide, so it is the most often
123
123
  omitted.
124
124
 
125
- A unit SHOULD also have a `file` and `line` number for source file location.
125
+ A test SHOULD also have a `file` and `line` number for source file location.
126
126
  This is the location of the test definition itself.
127
127
 
128
- A unit SHOULD provide the line of `source` code for the test.
128
+ A test SHOULD provide the line of `source` code for the test.
129
129
  This will be the line of code that `file` and `line` number references.
130
130
  Unlike `snippet` lines, the source line should be stripped of whitespace.
131
131
 
@@ -136,12 +136,12 @@ the source line in the center. Or, it MAY be an ordered map of verbatim
136
136
  and end wherever, but they MUST be consecutive and the source line MUST
137
137
  be among them.
138
138
 
139
- [EXPERIMENTAL] The `coverage` subsection MAY be provided, in which can have three optional
140
- fields: `file`, `line` and `code`. Where `file` specifies the source file being
141
- targeted by the test, `line` specifies the line number, range of line
142
- numbers (e.g. `1..4`) or an array of such, and `code` specifices the
143
- language construct being targeted. For example, `code` might be `Foo#bar`
144
- if the test targets the `bar` method of the `Foo` class.
139
+ [EXPERIMENTAL] The `coverage` subsection MAY be provided, which can have three
140
+ optional fields: `file`, `line` and `code`. Where `file` specifies the source
141
+ file being targeted by the test, `line` specifies the line number, range of line
142
+ numbers (e.g. `1..4`) or an array of such line or array of line numbaer,
143
+ and `code` specifices the language construct being targeted. For example, `code`
144
+ might be `Foo#bar` if the test targets the `bar` method of the `Foo` class.
145
145
 
146
146
  The `time` is the number of seconds that have elapsed since the
147
147
  the suite start time.
@@ -175,6 +175,7 @@ omission.
175
175
  (assertion fail) must_equal
176
176
  1
177
177
  2
178
+ class: EqualityAssertion
178
179
  file: test/test_foo.rb
179
180
  line: 50
180
181
  source: 1.must_equal == v
@@ -10,7 +10,7 @@ module TapOut
10
10
 
11
11
  #
12
12
  def initialize(options={})
13
- format = options[:format] || 'dotprogress'
13
+ format = options[:format]
14
14
  @reporter = Reporters.factory(format).new
15
15
  end
16
16
 
@@ -10,7 +10,7 @@ module TapOut
10
10
 
11
11
  # options[:format] - the report format to use
12
12
  def initialize(options={})
13
- format = options[:format] || 'dotprogress'
13
+ format = options[:format]
14
14
  @reporter = Reporters.factory(format).new
15
15
  end
16
16
 
@@ -9,7 +9,7 @@ module TapOut
9
9
 
10
10
  #
11
11
  def initialize(options={})
12
- format = options[:format] || 'dotprogress'
12
+ format = options[:format]
13
13
  @reporter = Reporters.factory(format).new
14
14
  @doc = ''
15
15
  @done = false
@@ -6,15 +6,21 @@ module TapOut
6
6
  # Namespace for Report Formats.
7
7
  module Reporters
8
8
 
9
+ #
10
+ DEAFULT_REPORTER = 'dot'
11
+
9
12
  # Returns a Hash of name to reporter class.
10
13
  def self.index
11
14
  @index ||= {}
12
15
  end
13
16
 
14
17
  # Returns a reporter class given it's name or a unique abbreviation of it.
18
+ # If `name` is `nil` then the default dot reporter is returned.
15
19
  def self.factory(name)
16
20
  list = index.keys.abbrev
17
- index[list[name]]
21
+ rptr = index[list[name || DEAFULT_REPORTER]]
22
+ raise ArgumentError, "Unrecognized reporter -- #{name.inspect}" unless rptr
23
+ rptr
18
24
  end
19
25
 
20
26
  # The Abstract class serves as a base class for all reporters. Reporters
@@ -100,7 +100,7 @@ module TapOut
100
100
  puts
101
101
  bad.each do |e|
102
102
  x = e['exception']
103
- message = x['message'].strip
103
+ message = [x['class'],x['message']].compact.join(': ').strip
104
104
  message = message.ansi(:red)
105
105
  puts(message)
106
106
  puts "#{x['file']}:#{x['line']}"
@@ -43,6 +43,7 @@ module TapOut::Reporters
43
43
  #backtrace = clean_backtrace(exception.backtrace)
44
44
  $stdout.puts "#{i}. " + (e['label']).ansi(:red)
45
45
  $stdout.puts
46
+ $stdout.puts " #{e['exception']['class']}" if e['exception']['class']
46
47
  $stdout.puts " #{e['exception']['message']}"
47
48
  $stdout.puts " #{e['exception']['file']}:#{e['exception']['line']}" #+ backtrace[0]
48
49
  $stdout.puts code_snippet(e['exception'])
@@ -54,6 +55,7 @@ module TapOut::Reporters
54
55
  #backtrace = clean_backtrace(exception.backtrace)
55
56
  $stdout.puts "#{i}. " + (e['label']).ansi(:yellow)
56
57
  $stdout.puts
58
+ $stdout.puts " #{e['exception']['class']}" if e['exception']['class']
57
59
  $stdout.puts " #{e['exception']['message']}"
58
60
  $stdout.puts " #{e['exception']['file']}:#{e['exception']['line']}" #+ backtrace[0..2].join(" \n")
59
61
  $stdout.puts code_snippet(e['exception'])
@@ -25,9 +25,12 @@ module TapOut::Reporters
25
25
 
26
26
  def fail(entry)
27
27
  super(entry)
28
+
29
+ msg = entry['exception'].values_at('class', 'message').compact.join(' - ')
30
+
28
31
  $stdout.puts "* " + entry['label'].ansi(:red) + " #{entry['source']}"
29
32
  $stdout.puts
30
- $stdout.puts " #{entry['exception']['message']}"
33
+ $stdout.puts " #{msg}"
31
34
  #$stdout.puts " " + ok.caller #clean_backtrace(exception.backtrace)[0]
32
35
  $stdout.puts
33
36
  $stdout.puts code_snippet(entry['exception'])
@@ -36,9 +39,12 @@ module TapOut::Reporters
36
39
 
37
40
  def error(entry)
38
41
  super(entry)
42
+
43
+ msg = entry['exception'].values_at('class', 'message').compact.join(' - ')
44
+
39
45
  $stdout.puts "* " + entry['label'].ansi(:yellow) + " #{entry['source']}"
40
46
  $stdout.puts
41
- $stdout.puts " #{entry['exception']['message']}" # error class?
47
+ $stdout.puts " #{msg}"
42
48
  #$stdout.puts " " + ok.caller #clean_backtrace(exception.backtrace)[0..2].join(" \n")
43
49
  $stdout.puts
44
50
  $stdout.puts code_snippet(entry['exception'])
@@ -53,7 +53,7 @@ module TapOut
53
53
  e = entry['exception']
54
54
 
55
55
  puts
56
- message = e['message'].strip
56
+ message = [e['class'], e['message']].compact.join(': ').strip
57
57
  message = message.ansi(:red)
58
58
  puts(message)
59
59
  puts "#{e['file']}:#{e['line']}"
@@ -64,8 +64,8 @@ module TapOut::Reporters
64
64
 
65
65
  body = []
66
66
  body << "ERROR #{x['file']}:#{x['line']}" #clean_backtrace(exception.backtrace)[0..2].join(" \n")
67
- #body << "#{exception.class}: #{entry['message']}"
68
- body << "#{x['message']}"
67
+ body << "#{x['class']}: #{x['message']}"
68
+ #body << "#{x['message']}"
69
69
  body << ""
70
70
  body << code_snippet(entry)
71
71
  body << ""
@@ -88,14 +88,16 @@ module TapOut
88
88
 
89
89
  # TODO: TAP-Y/J needs a field for the error class
90
90
  def error(doc)
91
- message = doc['exception']['message'].to_s
92
- #backtrace = "Exception `#{exception.class}' at " + clean_backtrace(exception.backtrace).join("\n")
93
- backtrace = "Exception at " + clean_backtrace(doc['exception']['backtrace'] || []).join("\n")
94
- message = message.ansi(:bold)
91
+ exception_class = doc['exception']['class'].to_s
92
+ message = doc['exception']['message'].to_s.ansi(:bold)
93
+ backtrace = "Exception `#{exception_class}' at " +
94
+ clean_backtrace(doc['exception']['backtrace'] || []).join("\n")
95
+
95
96
  puts("#{ERROR}")
96
97
  puts(message.tabto(8))
97
98
  puts "STDERR:".tabto(8)
98
99
  puts(backtrace.tabto(8))
100
+
99
101
  show_captured_output
100
102
  end
101
103
 
@@ -8,7 +8,7 @@ module TapOut
8
8
  def self.metadata
9
9
  @metadata ||= (
10
10
  require 'yaml'
11
- YAML.load_file(File.join(File.dirname(__FILE__), 'tapout.yml'))
11
+ YAML.load_file(File.join(File.dirname(__FILE__), '/../tapout.yml'))
12
12
  )
13
13
  end
14
14
 
data/lib/tapout.yml CHANGED
@@ -29,18 +29,17 @@ resources:
29
29
  code: http://github.com/rubyworks/tapout
30
30
  load_path:
31
31
  - lib
32
- extra:
33
- manifest: MANIFEST
32
+ extra: {}
34
33
  source:
35
34
  - PROFILE
36
35
  alternatives: []
37
36
  revision: 0
38
37
  name: tapout
39
38
  title: TapOut
40
- version: 0.3.0
39
+ version: 0.3.1
41
40
  summary: Progressive TAP Harness
42
41
  description: Tapout is a TAP consumer that can take any TAP, TAP-Y or TAP-J stream
43
42
  and output it in a variety of useful formats.
44
43
  organization: RubyWorks
45
44
  created: '2010-12-23'
46
- date: '2011-10-08'
45
+ date: '2011-10-18'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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-10-09 00:00:00.000000000 Z
12
+ date: 2011-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ansi
16
- requirement: &13022480 !ruby/object:Gem::Requirement
16
+ requirement: &15919940 !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: *13022480
24
+ version_requirements: *15919940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &13021420 !ruby/object:Gem::Requirement
27
+ requirement: &15964400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *13021420
35
+ version_requirements: *15964400
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: detroit
38
- requirement: &13020640 !ruby/object:Gem::Requirement
38
+ requirement: &15957180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *13020640
46
+ version_requirements: *15957180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: qed
49
- requirement: &13019220 !ruby/object:Gem::Requirement
49
+ requirement: &15391460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *13019220
57
+ version_requirements: *15391460
58
58
  description: Tapout is a TAP consumer that can take any TAP, TAP-Y or TAP-J stream
59
59
  and output it in a variety of useful formats.
60
60
  email: