ZenTest 4.9.1 → 4.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 4.9.2 / 2013-05-29
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Added autotest-suffix description to readme. (blowmage)
6
+ * zentest now outputs test classes for minitest 5
7
+
1
8
  === 4.9.1 / 2013-04-18
2
9
 
3
10
  * 2 minor enhancements:
data/README.txt CHANGED
@@ -85,6 +85,17 @@ one) and use that for your testlib instead:
85
85
  at.testlib = ".minitest"
86
86
  end
87
87
 
88
+ If you prefer to suffix test files with "_test.rb" (instead of the
89
+ default which prefixes test files with "test_") you can change the
90
+ mapping by installing the autotest-suffix plugin. To do this first
91
+ install the autotest-suffix gem:
92
+
93
+ $ gem install autotest-suffix
94
+
95
+ Then add the following to the ".autotest" file:
96
+
97
+ require "autotest/suffix"
98
+
88
99
  == SYNOPSIS
89
100
 
90
101
  ZenTest MyProject.rb TestMyProject.rb > missing.rb
data/lib/autotest.rb CHANGED
@@ -291,7 +291,7 @@ class Autotest
291
291
  self.output = $stderr
292
292
  self.prefix = nil
293
293
  self.sleep = 1
294
- self.testlib = "test/unit"
294
+ self.testlib = "minitest/autorun"
295
295
  specified_directories = ARGV.reject { |arg| arg.start_with?("-") } # options are not directories
296
296
  self.find_directories = specified_directories.empty? ? ['.'] : specified_directories
297
297
  self.unit_diff = nil
data/lib/zentest.rb CHANGED
@@ -64,7 +64,7 @@ end
64
64
 
65
65
  class ZenTest
66
66
 
67
- VERSION = "4.9.1"
67
+ VERSION = "4.9.2"
68
68
 
69
69
  include ZenTestMapping
70
70
 
@@ -482,7 +482,7 @@ class ZenTest
482
482
  indent = 0
483
483
  is_test_class = self.is_test_class(fullklasspath)
484
484
 
485
- clsname = $t ? "Test::Unit::TestCase" : "MiniTest::Unit::TestCase"
485
+ clsname = $t ? "Test::Unit::TestCase" : "Minitest::Test"
486
486
  superclass = is_test_class ? " < #{clsname}" : ''
487
487
 
488
488
  @result.push indentunit*indent + "class #{fullklasspath}#{superclass}"
@@ -30,7 +30,7 @@ class Autotest
30
30
  end
31
31
  end
32
32
 
33
- class TestAutotest < MiniTest::Unit::TestCase
33
+ class TestAutotest < Minitest::Test
34
34
 
35
35
  alias :deny :refute
36
36
 
@@ -395,7 +395,7 @@ test_error2(#{@test_class}):
395
395
  req = ".each { |f| require f }\""
396
396
 
397
397
  expected =
398
- [ "#{pre} -e \"%w[test/unit #{@test}]#{req}",
398
+ [ "#{pre} -e \"%w[minitest/autorun #{@test}]#{req}",
399
399
  "#{pre} test/test_fooby.rb -n \"/^(test_something1|test_something2)$/\""
400
400
  ].join("; ")
401
401
 
@@ -414,7 +414,7 @@ test_error2(#{@test_class}):
414
414
  req = ".each { |f| require f }\""
415
415
  post = "| unit_diff -u"
416
416
 
417
- expected = [ "#{pre} -e \"%w[test/unit #{@test}]#{req} #{post}",
417
+ expected = [ "#{pre} -e \"%w[minitest/autorun #{@test}]#{req} #{post}",
418
418
  "#{pre} test/test_fooby.rb -n \"/^(test_something1|test_something2)$/\" #{post}" ].join("; ")
419
419
 
420
420
  result = @a.make_test_cmd f
@@ -460,7 +460,7 @@ test_error2(#{@test_class}):
460
460
  end
461
461
 
462
462
  def test_testlib
463
- assert_equal "test/unit", @a.testlib
463
+ assert_equal "minitest/autorun", @a.testlib
464
464
 
465
465
  @a.testlib = "MONKEY"
466
466
  assert_equal "MONKEY", @a.testlib
data/test/test_focus.rb CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'minitest/autorun'
3
3
  require 'focus'
4
4
 
5
- class TestFocus < MiniTest::Unit::TestCase
5
+ class TestFocus < Minitest::Test
6
6
  def setup
7
7
  @x = 1
8
8
  end
@@ -9,7 +9,7 @@ $TESTING = true
9
9
 
10
10
  require 'unit_diff'
11
11
 
12
- class TestUnitDiff < MiniTest::Unit::TestCase
12
+ class TestUnitDiff < Minitest::Test
13
13
 
14
14
  def setup
15
15
  @diff = UnitDiff.new
data/test/test_zentest.rb CHANGED
@@ -139,7 +139,7 @@ end
139
139
 
140
140
  class TestTrueClass; end
141
141
 
142
- class TestZenTest < MiniTest::Unit::TestCase
142
+ class TestZenTest < Minitest::Test
143
143
  def setup
144
144
  @tester = ZenTest.new()
145
145
  end
@@ -187,7 +187,7 @@ class Something
187
187
  end
188
188
  end
189
189
 
190
- class TestSomething < MiniTest::Unit::TestCase
190
+ class TestSomething < Minitest::Test
191
191
  def test_class_method3
192
192
  raise NotImplementedError, 'Need to write test_class_method3'
193
193
  end
@@ -508,13 +508,13 @@ end
508
508
  HEADER = "\nrequire 'test/unit/testcase'\nrequire 'test/unit' if $0 == __FILE__\n\n"
509
509
 
510
510
  def test_testcase1
511
- expected = "#{HEADER}class Blah1\n def missingimpl(*args)\n raise NotImplementedError, 'Need to write missingimpl'\n end\nend\n\nclass TestBlah1 < MiniTest::Unit::TestCase\n def test_missingtest\n raise NotImplementedError, 'Need to write test_missingtest'\n end\nend\n\n# Number of errors detected: 2"
511
+ expected = "#{HEADER}class Blah1\n def missingimpl(*args)\n raise NotImplementedError, 'Need to write missingimpl'\n end\nend\n\nclass TestBlah1 < Minitest::Test\n def test_missingtest\n raise NotImplementedError, 'Need to write test_missingtest'\n end\nend\n\n# Number of errors detected: 2"
512
512
 
513
513
  assert_equal expected, util_testcase("Blah1", "TestBlah1")
514
514
  end
515
515
 
516
516
  def test_testcase2
517
- expected = "#{HEADER}class Something2::Blah2\n def missingimpl(*args)\n raise NotImplementedError, 'Need to write missingimpl'\n end\nend\n\nclass TestSomething2::TestBlah2 < MiniTest::Unit::TestCase\n def test_missingtest\n raise NotImplementedError, 'Need to write test_missingtest'\n end\nend\n\n# Number of errors detected: 2"
517
+ expected = "#{HEADER}class Something2::Blah2\n def missingimpl(*args)\n raise NotImplementedError, 'Need to write missingimpl'\n end\nend\n\nclass TestSomething2::TestBlah2 < Minitest::Test\n def test_missingtest\n raise NotImplementedError, 'Need to write test_missingtest'\n end\nend\n\n# Number of errors detected: 2"
518
518
 
519
519
  assert_equal expected, util_testcase("Something2::Blah2", "TestSomething2::TestBlah2")
520
520
  end
@@ -526,31 +526,31 @@ assert_equal expected, util_testcase("Something2::Blah2", "TestSomething2::TestB
526
526
  end
527
527
 
528
528
  def test_testcase4
529
- expected = "#{HEADER}class TestBlah4 < MiniTest::Unit::TestCase\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\n\n def test_missingtest2\n raise NotImplementedError, 'Need to write test_missingtest2'\n end\nend\n\n# Number of errors detected: 3"
529
+ expected = "#{HEADER}class TestBlah4 < Minitest::Test\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\n\n def test_missingtest2\n raise NotImplementedError, 'Need to write test_missingtest2'\n end\nend\n\n# Number of errors detected: 3"
530
530
 
531
531
  assert_equal expected, util_testcase("Blah4")
532
532
  end
533
533
 
534
534
  def test_testcase5
535
- expected = "#{HEADER}class TestMyHash5 < MiniTest::Unit::TestCase\n def test_index\n raise NotImplementedError, 'Need to write test_index'\n end\n\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\nend\n\n# Number of errors detected: 3"
535
+ expected = "#{HEADER}class TestMyHash5 < Minitest::Test\n def test_index\n raise NotImplementedError, 'Need to write test_index'\n end\n\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\nend\n\n# Number of errors detected: 3"
536
536
 
537
537
  assert_equal expected, util_testcase("MyHash5")
538
538
  end
539
539
 
540
540
  def test_testcase6
541
- expected = "#{HEADER}class TestMyModule6::TestMyClass6 < MiniTest::Unit::TestCase\n def test_index\n raise NotImplementedError, 'Need to write test_index'\n end\n\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\nend\n\n# Number of errors detected: 3"
541
+ expected = "#{HEADER}class TestMyModule6::TestMyClass6 < Minitest::Test\n def test_index\n raise NotImplementedError, 'Need to write test_index'\n end\n\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\nend\n\n# Number of errors detected: 3"
542
542
 
543
543
  assert_equal expected, util_testcase("MyModule6::MyClass6")
544
544
  end
545
545
 
546
546
  def test_testcase7
547
- expected = "#{HEADER}class TestMyModule7::TestMyClass7 < MiniTest::Unit::TestCase\n def test_index\n raise NotImplementedError, 'Need to write test_index'\n end\n\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\nend\n\n# Number of errors detected: 3"
547
+ expected = "#{HEADER}class TestMyModule7::TestMyClass7 < Minitest::Test\n def test_index\n raise NotImplementedError, 'Need to write test_index'\n end\n\n def test_missingtest1\n raise NotImplementedError, 'Need to write test_missingtest1'\n end\nend\n\n# Number of errors detected: 3"
548
548
 
549
549
  assert_equal expected, util_testcase("MyModule7::MyClass7")
550
550
  end
551
551
 
552
552
  def test_testcase8
553
- expected = "#{HEADER}class TestMyClass8 < MiniTest::Unit::TestCase\n def test_class_foobar\n raise NotImplementedError, 'Need to write test_class_foobar'\n end\n\n def test_class_foobaz\n raise NotImplementedError, 'Need to write test_class_foobaz'\n end\nend\n\n# Number of errors detected: 3"
553
+ expected = "#{HEADER}class TestMyClass8 < Minitest::Test\n def test_class_foobar\n raise NotImplementedError, 'Need to write test_class_foobar'\n end\n\n def test_class_foobaz\n raise NotImplementedError, 'Need to write test_class_foobaz'\n end\nend\n\n# Number of errors detected: 3"
554
554
 
555
555
  assert_equal expected, util_testcase("MyClass8")
556
556
  end
@@ -566,7 +566,7 @@ assert_equal expected, util_testcase("Something2::Blah2", "TestSomething2::TestB
566
566
  pims = TrueClass.public_instance_methods(false)
567
567
  TrueClass.send :remove_method, :inspect if pims.include? :inspect # 2.0 only
568
568
 
569
- expected = "#{HEADER}class TestTrueClass < MiniTest::Unit::TestCase\n def test_and\n raise NotImplementedError, 'Need to write test_and'\n end\n\n def test_carat\n raise NotImplementedError, 'Need to write test_carat'\n end\n\n def test_or\n raise NotImplementedError, 'Need to write test_or'\n end\n\n def test_to_s\n raise NotImplementedError, 'Need to write test_to_s'\n end\nend\n\n# Number of errors detected: 4"
569
+ expected = "#{HEADER}class TestTrueClass < Minitest::Test\n def test_and\n raise NotImplementedError, 'Need to write test_and'\n end\n\n def test_carat\n raise NotImplementedError, 'Need to write test_carat'\n end\n\n def test_or\n raise NotImplementedError, 'Need to write test_or'\n end\n\n def test_to_s\n raise NotImplementedError, 'Need to write test_to_s'\n end\nend\n\n# Number of errors detected: 4"
570
570
 
571
571
  assert_equal expected, util_testcase("TestTrueClass")
572
572
  end
@@ -10,7 +10,7 @@ class Dummy
10
10
  include ZenTestMapping
11
11
  end
12
12
 
13
- class TestZentestMapping < MiniTest::Unit::TestCase
13
+ class TestZentestMapping < Minitest::Test
14
14
  def setup
15
15
  @tester = Dummy.new
16
16
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZenTest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
8
  - 9
9
- - 1
10
- version: 4.9.1
9
+ - 2
10
+ version: 4.9.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -37,7 +37,7 @@ cert_chain:
37
37
  FBHgymkyj/AOSqKRIpXPhjC6
38
38
  -----END CERTIFICATE-----
39
39
 
40
- date: 2013-04-18 00:00:00 Z
40
+ date: 2013-05-30 00:00:00 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: minitest
@@ -47,11 +47,11 @@ dependencies:
47
47
  requirements:
48
48
  - - ~>
49
49
  - !ruby/object:Gem::Version
50
- hash: 21
50
+ hash: 31
51
51
  segments:
52
- - 4
53
- - 7
54
- version: "4.7"
52
+ - 5
53
+ - 0
54
+ version: "5.0"
55
55
  type: :development
56
56
  version_requirements: *id001
57
57
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file