ZenTest 4.7.0 → 4.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +10 -0
- data/README.txt +5 -4
- data/lib/autotest.rb +4 -3
- data/lib/zentest.rb +9 -4
- data/test/test_zentest.rb +9 -9
- metadata +16 -15
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
=== 4.8.0 / 2012-05-04
|
2
|
+
|
3
|
+
* 1 minor enhancement:
|
4
|
+
|
5
|
+
* Added Minitest generation to zentest (use -t to generate for test/unit)
|
6
|
+
|
7
|
+
* 1 bug fix:
|
8
|
+
|
9
|
+
* Fixes and clarifications to Autotest#find_file. (hugh sasse)
|
10
|
+
|
1
11
|
=== 4.7.0 / 2012-03-15
|
2
12
|
|
3
13
|
* 2 minor enhancements:
|
data/README.txt
CHANGED
@@ -8,10 +8,11 @@ rdoc :: http://zentest.rubyforge.org/ZenTest
|
|
8
8
|
ZenTest provides 4 different tools: zentest, unit_diff, autotest, and
|
9
9
|
multiruby.
|
10
10
|
|
11
|
-
|
12
|
-
code based on simple naming rules, enabling XP at a much quicker
|
13
|
-
|
14
|
-
|
11
|
+
zentest scans your target and unit-test code and writes your missing
|
12
|
+
code based on simple naming rules, enabling XP at a much quicker pace.
|
13
|
+
zentest only works with Ruby and Minitest or Test::Unit. There is
|
14
|
+
enough evidence to show that this is still proving useful to users, so
|
15
|
+
it stays.
|
15
16
|
|
16
17
|
unit_diff is a command-line filter to diff expected results from
|
17
18
|
actual results and allow you to quickly see exactly what is wrong.
|
data/lib/autotest.rb
CHANGED
@@ -45,7 +45,7 @@ $TESTING = false unless defined? $TESTING
|
|
45
45
|
# * Test class names must start with Test
|
46
46
|
# * Implementation files must be stored in lib/
|
47
47
|
# * Implementation files must match up with a test file named
|
48
|
-
# test_
|
48
|
+
# test_.*<impl-name>.rb
|
49
49
|
#
|
50
50
|
# Strategy:
|
51
51
|
#
|
@@ -513,10 +513,11 @@ class Autotest
|
|
513
513
|
order = []
|
514
514
|
Find.find target do |f|
|
515
515
|
Find.prune if f =~ self.exceptions
|
516
|
+
Find.prune if f =~ /^\.\/tmp/ # temp dir, used by isolate
|
516
517
|
|
517
|
-
next
|
518
|
+
next unless File.file? f
|
518
519
|
next if f =~ /(swp|~|rej|orig)$/ # temporary/patch files
|
519
|
-
next if f =~
|
520
|
+
next if f =~ /(,v)$/ # RCS files
|
520
521
|
next if f =~ /\/\.?#/ # Emacs autosave/cvs merge files
|
521
522
|
|
522
523
|
filename = f.sub(/^\.\//, '')
|
data/lib/zentest.rb
CHANGED
@@ -12,6 +12,7 @@ require 'zentest_mapping'
|
|
12
12
|
|
13
13
|
$:.unshift( *$I.split(/:/) ) if defined? $I and String === $I
|
14
14
|
$r = false unless defined? $r # reverse mapping for testclass names
|
15
|
+
$t ||= false # test/unit instead of minitest
|
15
16
|
|
16
17
|
if $r then
|
17
18
|
# all this is needed because rails is retarded
|
@@ -34,7 +35,7 @@ end
|
|
34
35
|
##
|
35
36
|
# ZenTest scans your target and unit-test code and writes your missing
|
36
37
|
# code based on simple naming rules, enabling XP at a much quicker
|
37
|
-
# pace. ZenTest only works with Ruby and Test::Unit.
|
38
|
+
# pace. ZenTest only works with Ruby and Minitest or Test::Unit.
|
38
39
|
#
|
39
40
|
# == RULES
|
40
41
|
#
|
@@ -57,7 +58,7 @@ end
|
|
57
58
|
|
58
59
|
class ZenTest
|
59
60
|
|
60
|
-
VERSION = '4.
|
61
|
+
VERSION = '4.8.0'
|
61
62
|
|
62
63
|
include ZenTestMapping
|
63
64
|
|
@@ -483,7 +484,10 @@ class ZenTest
|
|
483
484
|
indent = 0
|
484
485
|
is_test_class = self.is_test_class(fullklasspath)
|
485
486
|
|
486
|
-
|
487
|
+
clsname = $t ? "Test::Unit::TestCase" : "MiniTest::Unit::TestCase"
|
488
|
+
superclass = is_test_class ? " < #{clsname}" : ''
|
489
|
+
|
490
|
+
@result.push indentunit*indent + "class #{fullklasspath}#{superclass}"
|
487
491
|
indent += 1
|
488
492
|
|
489
493
|
meths = []
|
@@ -522,7 +526,7 @@ usage: #{File.basename $0} [options] test-and-implementation-files...
|
|
522
526
|
|
523
527
|
ZenTest scans your target and unit-test code and writes your missing
|
524
528
|
code based on simple naming rules, enabling XP at a much quicker
|
525
|
-
pace. ZenTest only works with Ruby and Test::Unit.
|
529
|
+
pace. ZenTest only works with Ruby and Minitest or Test::Unit.
|
526
530
|
|
527
531
|
ZenTest uses the following rules to figure out what code should be
|
528
532
|
generated:
|
@@ -544,6 +548,7 @@ options:
|
|
544
548
|
-v display version information
|
545
549
|
-r Reverse mapping (ClassTest instead of TestClass)
|
546
550
|
-e (Rapid XP) eval the code generated instead of printing it
|
551
|
+
-t test/unit generation (default is minitest).
|
547
552
|
|
548
553
|
EO_USAGE
|
549
554
|
end
|
data/test/test_zentest.rb
CHANGED
@@ -187,7 +187,7 @@ class Something
|
|
187
187
|
end
|
188
188
|
end
|
189
189
|
|
190
|
-
class TestSomething <
|
190
|
+
class TestSomething < MiniTest::Unit::TestCase
|
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 <
|
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"
|
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 <
|
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"
|
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 <
|
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"
|
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 <
|
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"
|
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 <
|
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"
|
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 <
|
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"
|
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 <
|
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"
|
554
554
|
|
555
555
|
assert_equal expected, util_testcase("MyClass8")
|
556
556
|
end
|
@@ -561,7 +561,7 @@ assert_equal expected, util_testcase("Something2::Blah2", "TestSomething2::TestB
|
|
561
561
|
TrueClass.send :remove_method, :taguri, :taguri=, :to_yaml rescue nil
|
562
562
|
end
|
563
563
|
|
564
|
-
expected = "#{HEADER}class TestTrueClass <
|
564
|
+
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"
|
565
565
|
|
566
566
|
assert_equal expected, util_testcase("TestTrueClass")
|
567
567
|
end
|
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:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 4
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
version: 4.
|
10
|
+
version: 4.8.0
|
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: 2012-
|
40
|
+
date: 2012-05-04 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:
|
50
|
+
hash: 27
|
51
51
|
segments:
|
52
52
|
- 2
|
53
|
-
-
|
54
|
-
version: "2.
|
53
|
+
- 12
|
54
|
+
version: "2.12"
|
55
55
|
type: :development
|
56
56
|
version_requirements: *id001
|
57
57
|
- !ruby/object:Gem::Dependency
|
@@ -77,21 +77,22 @@ dependencies:
|
|
77
77
|
requirements:
|
78
78
|
- - ~>
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
hash:
|
80
|
+
hash: 7
|
81
81
|
segments:
|
82
|
-
-
|
83
|
-
-
|
84
|
-
version: "
|
82
|
+
- 3
|
83
|
+
- 0
|
84
|
+
version: "3.0"
|
85
85
|
type: :development
|
86
86
|
version_requirements: *id003
|
87
87
|
description: |-
|
88
88
|
ZenTest provides 4 different tools: zentest, unit_diff, autotest, and
|
89
89
|
multiruby.
|
90
90
|
|
91
|
-
|
92
|
-
code based on simple naming rules, enabling XP at a much quicker
|
93
|
-
|
94
|
-
|
91
|
+
zentest scans your target and unit-test code and writes your missing
|
92
|
+
code based on simple naming rules, enabling XP at a much quicker pace.
|
93
|
+
zentest only works with Ruby and Minitest or Test::Unit. There is
|
94
|
+
enough evidence to show that this is still proving useful to users, so
|
95
|
+
it stays.
|
95
96
|
|
96
97
|
unit_diff is a command-line filter to diff expected results from
|
97
98
|
actual results and allow you to quickly see exactly what is wrong.
|
metadata.gz.sig
CHANGED
Binary file
|