minitap 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/.index CHANGED
@@ -56,7 +56,7 @@ paths:
56
56
  - lib
57
57
  summary: TAP-Y/J reporters for MiniTest
58
58
  title: MiniTap
59
- version: 0.4.0
59
+ version: 0.4.1
60
60
  name: minitap
61
61
  description: MiniTap provides a MiniTest TAP-Y/J report format suitable for use with
62
62
  TAPOUT.
data/HISTORY.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # RELEASE HISTORY
2
2
 
3
+ ## 0.4.1 | 2013-03-18
4
+
5
+ Minor release improves upon backtrace filtering and makes
6
+ the hook extensions more robust when non-minitap runners
7
+ are used even though minitap has been requried.
8
+
9
+ Changes:
10
+
11
+ * Use $RUBY_IGNORE_CALLERS for backtrace filtering.
12
+ * Endure hook methods exist before using them.
13
+
14
+
3
15
  ## 0.4.0 | 2013-03-17
4
16
 
5
17
  MiniTap v0.4.0 is a heavy refactorization of the code based on
@@ -1,9 +1,7 @@
1
1
  # MiniTest adaptor for tapout.
2
2
 
3
- begin
4
- gem 'minitest'
5
- rescue
6
- end
3
+ # Have to make sure the latest version of minitest is used.
4
+ begin; gem 'minitest'; rescue; end
7
5
 
8
6
  require 'minitest/unit'
9
7
  require 'minitap/ignore_callers'
@@ -28,8 +26,9 @@ module MiniTest
28
26
  REVISION = 4
29
27
 
30
28
  # Backtrace patterns to be omitted.
31
- IGNORE_CALLERS = ::RUBY_IGNORE_CALLERS
29
+ IGNORE_CALLERS = $RUBY_IGNORE_CALLERS
32
30
 
31
+ # Test results.
33
32
  attr_reader :test_results
34
33
 
35
34
  attr_accessor :suites_start_time
@@ -72,9 +71,9 @@ module MiniTest
72
71
  trigger_callback(:before_suite, suite)
73
72
 
74
73
  super_result = nil
75
- #@_stdout, @_stderr = capture_io do
74
+ @_stdout, @_stderr = capture_io do
76
75
  super_result = super(suite, type)
77
- #end
76
+ end
78
77
  super_result
79
78
  ensure
80
79
  trigger_callback(:after_suite, suite)
@@ -474,6 +473,7 @@ module MiniTest
474
473
  end
475
474
 
476
475
  ##
476
+ # Used to keep a record of each test and it's result.
477
477
  #
478
478
  class TestRecord < Struct.new(:suite, :test, :assertions, :time, :exception)
479
479
  def result
@@ -550,17 +550,22 @@ module MiniTest
550
550
  =end
551
551
 
552
552
  ##
553
+ # Around advice.
553
554
  #
554
555
  module AroundTestHooks
555
556
  def self.before_test(instance)
556
- MiniTest::Unit.runner.before_test(instance.class, instance.__name__)
557
+ if before_test = (MiniTest::Unit.runner.method(:before_test) rescue nil)
558
+ before_test.call(instance.class, instance.__name__)
559
+ end
557
560
  end
558
561
 
559
562
  def self.after_test(instance)
560
563
  # MiniTest < 4.1.0 sends #record after all teardown hooks, so don't call
561
564
  # #after_test here.
562
565
  if MiniTest::Unit::VERSION > "4.1.0"
563
- MiniTest::Unit.runner.after_test(instance.class, instance.__name__)
566
+ if after_test = (MiniTest::Unit.runner.method(:after_test) rescue nil)
567
+ after_test.call(instance.class, instance.__name__)
568
+ end
564
569
  end
565
570
  end
566
571
 
@@ -580,6 +585,7 @@ module MiniTest
580
585
  end
581
586
 
582
587
  ##
588
+ # TAP-Y adapater.
583
589
  #
584
590
  class TapY < MiniTap
585
591
  def initialize
@@ -615,6 +621,8 @@ module MiniTest
615
621
  end
616
622
  end
617
623
 
624
+ ##
625
+ # TAP-J adapater.
618
626
  #
619
627
  class TapJ < MiniTap
620
628
  def initialize
@@ -1,8 +1,5 @@
1
1
  ignore = /(lib|bin)#{Regexp.escape(File::SEPARATOR)}minitap/
2
2
 
3
- if defined?(RUBY_IGNORE_CALLERS)
4
- RUBY_IGNORE_CALLERS << ignore
5
- else
6
- RUBY_IGNORE_CALLERS = [ignore]
7
- end
3
+ $RUBY_IGNORE_CALLERS = [] unless defined?($RUBY_IGNORE_CALLERS)
4
+ $RUBY_IGNORE_CALLERS << ignore
8
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-17 00:00:00.000000000 Z
12
+ date: 2013-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: tapout