minitap 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a1aac6d60ba24d1f8587c4697194bb57f3babb1
4
- data.tar.gz: 7c697b1e323b760f78d257714b6d0b619b7150d2
3
+ metadata.gz: 3287678f9370253212c9674659d5e2cb9b316511
4
+ data.tar.gz: 04e448c48c2bdd11d00df0bcc2eff1006fd72766
5
5
  SHA512:
6
- metadata.gz: 4c8433a7a7e624f2f6b96e18edff3bd6dc7a0a8ad725983d61a859d0379e85360c4363adf7dcb86b93bfb98daae3d95f20a05d9f200328e77a68a4d401e04af5
7
- data.tar.gz: daeac831863b03bb58500d18a1d0d52c6aded6ab6e27d55c887bbc6801b3da0ca315e96d0e39df82643022188a52b8df1ee5a587643573129d8a846b73c5ef07
6
+ metadata.gz: 486e83b77907a254da1eedd730adc379ec92369fb03437b99d7b8d31aed2bf0f5d4d25930f5bd833767f762be3ed34f6abf623daa351e6b320e59b1f4ae38b7f
7
+ data.tar.gz: 505ea556923d93696cfa2f03a53fa942bad75a1c8d60f3602f010dce7f00478677bd7bd1386bc58639f2f6aba38060b67d21b2e4dbd2066e8f60b17902e9a7f6
data/.index CHANGED
@@ -12,6 +12,8 @@ requirements:
12
12
  name: tapout
13
13
  - version: 5.0~
14
14
  name: minitest
15
+ - version: 0.0.2+
16
+ name: minitest-reporter-api
15
17
  - groups:
16
18
  - test
17
19
  development: true
@@ -60,5 +62,5 @@ title: MiniTap
60
62
  summary: TAP-Y/J reporters for MiniTest
61
63
  description: MiniTap provides a MiniTest TAP-Y/J report format suitable for use with
62
64
  TAPOUT.
63
- version: 0.5.1
64
- date: '2013-11-16'
65
+ version: 0.5.2
66
+ date: '2013-11-18'
data/HISTORY.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # RELEASE HISTORY
2
2
 
3
+ ## 0.5.2 | 2013-11-18
4
+
5
+ This release makes it possible to specify reporters in code
6
+ (again), and not just on the command line. This makes it easier
7
+ to use with other test and build tools such as Rake.
8
+
9
+ Changes:
10
+
11
+ * Add support for in code configuration of reporter.
12
+ * Use minitest-reporter-api gem to support in code reporter config.
13
+
14
+
3
15
  ## 0.5.1 | 2013-11-16
4
16
 
5
17
  This release simply removes all the remaing v4 code that
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  [![Flattr Me](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/324911/Rubyworks-Ruby-Development-Fund)
11
11
 
12
12
 
13
- ## About
13
+ # About
14
14
 
15
15
  The MiniTap project provides a TAP-Y and TAP-J output reporters for
16
16
  the MiniTest test framework --the test framework that comes standard
@@ -20,13 +20,15 @@ See [TAPOUT](http://rubyworks.github.com/tapout) for more information about
20
20
  TAP-Y/J formats.
21
21
 
22
22
 
23
- ## Usage
23
+ # Usage
24
24
 
25
- ### Minitest 5+
25
+ ## Minitest 5
26
26
 
27
27
  Minitest 5 has a new report system and plug-in API. Minitap takes advantage
28
28
  of this new API to allow the TAP-Y or TAP-J formats to be selected via command-line
29
- options instead of requiring that the format be set in the test helper scripts.
29
+ options as an alternative to setting the format in test helper scripts.
30
+
31
+ ### Via Command Line
30
32
 
31
33
  To use simply add `--tapy` or `--tapj` after an isolated `-` separator on the
32
34
  ruby test command invocation, e.g.
@@ -49,10 +51,28 @@ Then pipe the output to the `tapout` command, e.g.
49
51
 
50
52
  $ ruby test/some_test.rb - --tapy | tapout progressbar
51
53
 
52
- And that's all there is too it.
54
+ ### Via Helper Script
55
+
56
+ To use via test helper script, require the `minitap` library after `minitest/autorun`
57
+ and assign `Minitest.reporter` to the Minitap reporter to be used.
58
+
59
+ require "minitest/autorun"
60
+ require "minitap"
61
+
62
+ Minitest.reporter = Minitap::TapY
63
+
64
+ Then pipe the output to the `tapout` command, e.g.
65
+
66
+ $ ruby -Ilib test/runner.rb | tapout progrssbar
67
+
68
+ Or using Rake:
69
+
70
+ $ rake test | tapout progressbar
71
+
72
+ You may need the `-q` option for Rake to supress extraneous output.
53
73
 
54
74
 
55
- ### MiniTest 4
75
+ ## MiniTest 4
56
76
 
57
77
  If you are still using MiniTest 4.x you will need to use Minitap version 4.x
58
78
  as well. In your dependencies be sure to specify this version. For example in
@@ -93,7 +113,7 @@ Then pipe the output to the `tapout` command, e.g.
93
113
  $ rpt=tapy ruby test/some_test.rb | tapout progressbar
94
114
 
95
115
 
96
- ## Copying
116
+ # Copying
97
117
 
98
118
  Copyright (c) 2011 Rubyworks
99
119
 
data/lib/minitap.rb CHANGED
@@ -0,0 +1,11 @@
1
+ #gem "minitest", "~> 5.0"
2
+
3
+ require 'minitest'
4
+ require 'minitest/reporter_api'
5
+ require 'minitap/minitest5'
6
+
7
+ module Minitap
8
+ TapY = Minitest::TapY
9
+ TapJ = Minitest::TapJ
10
+ end
11
+
@@ -0,0 +1,8 @@
1
+ require 'minitest/autorun'
2
+ require 'minitap'
3
+
4
+ # Default it TapY.
5
+ #Minitest.reporter = Minitest::TapJ
6
+ Minitest.reporter = Minitest::TapY
7
+
8
+
@@ -36,7 +36,9 @@ module Minitest
36
36
  attr_accessor :test_start_time
37
37
 
38
38
  # Initialize new Minitap Minitest reporter.
39
- def initialize(io = $stdout, options = {})
39
+ def initialize(options = {})
40
+ io = options.delete(:io) || $stdout
41
+
40
42
  super(io, options)
41
43
 
42
44
  #@_stdout = StringIO.new
@@ -808,9 +810,9 @@ module Minitest
808
810
  # TAP-Y adapater.
809
811
  #
810
812
  class TapY < Minitap
811
- def initialize(io=$stdout, options={})
813
+ def initialize(options={})
812
814
  require 'yaml' unless respond_to?(:to_yaml)
813
- super(io, options)
815
+ super(options)
814
816
  end
815
817
 
816
818
  def tapout_before_suite()
@@ -845,9 +847,9 @@ module Minitest
845
847
  # TAP-J adapater.
846
848
  #
847
849
  class TapJ < Minitap
848
- def initialize(io=$stdout, options={})
850
+ def initialize(options={})
849
851
  require 'json' unless respond_to?(:to_json)
850
- super(io, options)
852
+ super(options)
851
853
  end
852
854
 
853
855
  def tapout_before_suite()
@@ -1,14 +1,26 @@
1
1
  module Minitest
2
2
 
3
+ #
3
4
  def self.plugin_minitap_options(opts, options)
4
5
  opts.on "--tapy", "Use TapY reporter." do
5
6
  options[:minitap] = 'tapy'
6
7
  end
8
+
7
9
  opts.on "--tapj", "Use TapJ reporter." do
8
10
  options[:minitap] = 'tapj'
9
11
  end
12
+
13
+ # DEPRECATED Thanks to minitest-reporter-api gem.
14
+ #unless options[:minitap]
15
+ # if defined?(Minitest::TapY) && self.reporter == Minitest::TapY
16
+ # options[:minitap] = 'tapy'
17
+ # elsif defined?(Minitest::TapJ) && self.reporter == Minitest::TapJ
18
+ # options[:minitap] = 'tapj'
19
+ # end
20
+ #end
10
21
  end
11
22
 
23
+ #
12
24
  def self.plugin_minitap_init(options)
13
25
  if options[:minitap]
14
26
  require 'minitap/minitest5'
@@ -17,9 +29,9 @@ module Minitest
17
29
 
18
30
  case options[:minitap] || ENV['rpt']
19
31
  when 'tapj'
20
- self.reporter << TapJ.new(options[:io], options)
32
+ self.reporter << TapJ.new(options)
21
33
  when 'tapy'
22
- self.reporter << TapY.new(options[:io], options)
34
+ self.reporter << TapY.new(options)
23
35
  end
24
36
  end
25
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - trans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-16 00:00:00.000000000 Z
11
+ date: 2013-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tapout
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '5.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest-reporter-api
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.2
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: qed
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -95,6 +109,7 @@ extra_rdoc_files:
95
109
  files:
96
110
  - .index
97
111
  - .yardopts
112
+ - lib/minitap/autorun.rb
98
113
  - lib/minitap/ignore_callers.rb
99
114
  - lib/minitap/minitest5.rb
100
115
  - lib/minitap.rb