tapout 0.4.4 → 0.4.5

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: 894ae68c00afca1ffdb08227b13c27b153cf89b4
4
- data.tar.gz: fb29eb396e27bccc98a60fafb248d257d5bf63b3
3
+ metadata.gz: 0ef865a8e6a2ba4a549207c84ca0f367bdd176ad
4
+ data.tar.gz: 105a3907b7d99264cf29757198664f94a24b59da
5
5
  SHA512:
6
- metadata.gz: e4484f2dce824135bdf68c283c660462f056bde926bcc62d71678bbf1026d744a27f6e03529d338e180fad489fb7276114c21b99b2a1f3ae396553682ef8f345
7
- data.tar.gz: dd9b9af957e1d374785122361f92af2829160055be02710f92f8cd6db7b025a24cb2a0e670521225978e77717bef7af538888428ac7f99b6a2b79ae0ac879062
6
+ metadata.gz: 201e038919117862600db3d702e81a1524965dbd359e85f7d80bb116de7a9ae4e6a95a6fc1f81192c22e0dac8a7178e6c0f6050528d1c45d5046fe6c0653aebf
7
+ data.tar.gz: 036b6bf3485ab03f0f99fd5701ceac773278ebd2bf608adc3da4e44fb3d6b32bb4f341dcd39be69e21ce85263d2ef6927079c5e5e6137f59b440f6950a4b743c
data/.index CHANGED
@@ -66,5 +66,5 @@ summary: Progressive TAP Harness
66
66
  created: '2010-12-23'
67
67
  description: Tapout is a TAP consumer that can take any TAP, TAP-Y or TAP-J stream
68
68
  and output it in a variety of useful formats.
69
- version: 0.4.4
70
- date: '2013-11-18'
69
+ version: 0.4.5
70
+ date: '2013-11-20'
data/HISTORY.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # RELEASE HISTORY
2
2
 
3
+ ## 0.4.5 / 2013-11-20
4
+
5
+ Added some convenience methods for test runners using tapout.
6
+
7
+ Changes:
8
+
9
+ * Add Tapout::Utility and toplevel tapout interface.
10
+
11
+
12
+ ## 0.4.4 / 2013-11-19
13
+
14
+ This release simply makes some improvements to pause and resume
15
+ handlers.
16
+
17
+ Changes:
18
+
19
+ * YAML document markers may not always be enough.
20
+ * Rely on DLE (16.chr) and ETB (23.chr) for pause and resume.
21
+
22
+
3
23
  ## 0.4.3 / 2013-11-18
4
24
 
5
25
  New feature allows producers to emit a *pause document* and
@@ -66,5 +66,5 @@ summary: Progressive TAP Harness
66
66
  created: '2010-12-23'
67
67
  description: Tapout is a TAP consumer that can take any TAP, TAP-Y or TAP-J stream
68
68
  and output it in a variety of useful formats.
69
- version: 0.4.4
70
- date: '2013-11-18'
69
+ version: 0.4.5
70
+ date: '2013-11-20'
@@ -15,8 +15,10 @@ module Tapout
15
15
  #
16
16
  def initialize(options={})
17
17
  format = options[:format]
18
+ input = options[:input]
19
+
18
20
  @reporter = Reporters.factory(format).new
19
- @input = options[:input] || $stdin
21
+ @input = input || $stdin
20
22
 
21
23
  @resume = NEW_DOCUMENT
22
24
  end
@@ -56,6 +56,9 @@ module Tapout
56
56
  @skipped = []
57
57
  @omitted = []
58
58
 
59
+ #$stdin.sync = true
60
+ $stdout.sync = true
61
+
59
62
  @case_stack = []
60
63
  @source = {}
61
64
  @exit_code = 0 # assume passing
@@ -530,6 +533,13 @@ module Tapout
530
533
  Tapout.config
531
534
  end
532
535
 
536
+ private
537
+
538
+ #def puts(*s)
539
+ # super(*s)
540
+ # $stdout.flush
541
+ #end
542
+
533
543
  end#class Abstract
534
544
 
535
545
  end#module Reporters
@@ -0,0 +1,74 @@
1
+ module Tapout
2
+
3
+ ##
4
+ # Provides some convenience methods for programs using tapout for testing.
5
+ # Be sure to require this script to use it, e.g. in `test_helper.rb`
6
+ #
7
+ # require 'tapout/utility'
8
+ #
9
+ class Utility
10
+
11
+ # Initialize new Utility instance.
12
+ #
13
+ # input - An input I/O, defaults to STDOUT>
14
+ #
15
+ def initialize(output=STDOUT)
16
+ @output = output
17
+ end
18
+
19
+ # Pause tapout processing. This method sends a `16.chr` signal
20
+ # to the output.
21
+ #
22
+ # If a block is given, the block will be called after the pause.
23
+ # Then the block finishes, processing with be automatically resumed.
24
+ #
25
+ # taoput.pause do
26
+ # binding.pry
27
+ # end
28
+ #
29
+ def pause
30
+ @output.puts 16.chr
31
+ if block_given?
32
+ yield
33
+ resume
34
+ end
35
+ end
36
+
37
+ # Resume tapout processing. This method sends a `23.chr` signal
38
+ # to the output.
39
+ def resume
40
+ @output.puts 23.chr
41
+ end
42
+
43
+ # When using binding.pry while testing with tapout, it is best
44
+ # to tell tapout to pause processing first. This method provides
45
+ # a shortcut for doing exactly with pry.
46
+ #
47
+ # Instead of:
48
+ #
49
+ # binding.pry
50
+ #
51
+ # use
52
+ #
53
+ # tapout.pry(binding)
54
+ #
55
+ def pry(binding)
56
+ pause
57
+ binding.pry
58
+ resume
59
+ end
60
+
61
+ end
62
+
63
+ end
64
+
65
+ # Instance of Tapout::Utility.
66
+ #
67
+ # tapout.pause { binding.pry }
68
+ #
69
+ # Returns Tapout::Utility.
70
+ def tapout(output=STDOUT)
71
+ $tapout ||= {}
72
+ $tapout[output] ||= Tapout::Utility.new(output)
73
+ end
74
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Sawyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi
@@ -125,6 +125,7 @@ files:
125
125
  - lib/tapout/reporters/tap_reporter.rb
126
126
  - lib/tapout/reporters/turn_reporter.rb
127
127
  - lib/tapout/reporters.rb
128
+ - lib/tapout/utility.rb
128
129
  - lib/tapout/version.rb
129
130
  - lib/tapout.rb
130
131
  - lib/tapout.yml