heckle 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,12 @@
1
- == 1.4.0 / 2007-05-18
1
+ === 1.4.1 / 2007-06-05
2
+
3
+ * 3 bug fixes:
4
+ * Add zentest as a heckle dependency. Closes #10996
5
+ * Fixed heckling of call with blocks.
6
+ * Fix test_unit_heckler's test_pass? so it returns the result of the
7
+ run rather than ARGV.clear
8
+
9
+ === 1.4.0 / 2007-05-18
2
10
 
3
11
  * 2 major enhancements:
4
12
  * Method calls are now heckled (by removal).
@@ -8,7 +16,7 @@
8
16
  * Specify nodes to be included/excluded in heckle with -n/-x.
9
17
  * Test only assignments with --assignments
10
18
 
11
- == 1.3.0 / 2007-02-12
19
+ === 1.3.0 / 2007-02-12
12
20
 
13
21
  * 1 major enhancement:
14
22
  * Unified diffs for mutatated methods
@@ -21,7 +29,7 @@
21
29
  * Aborts when an unknown method is supplied.
22
30
  * Escapes slashes in random regexps.
23
31
 
24
- == 1.2.0 / 2007-01-15
32
+ === 1.2.0 / 2007-01-15
25
33
 
26
34
  * 2 major enhancements:
27
35
  * Timeout for tests set dynamically and overridable with -T
@@ -33,14 +41,14 @@
33
41
  * 1 bug fix:
34
42
  * Fixed the infinite loop caused by syntax errors
35
43
 
36
- == 1.1.1 / 2006-12-20
44
+ === 1.1.1 / 2006-12-20
37
45
 
38
46
  * 3 bug fixes:
39
47
  * Load tests properly when supplying method name.
40
48
  * Make sure random symbols have at least one character.
41
49
  * Removed all extra warnings from the unit tests. Consolidated and cleaned.
42
50
 
43
- == 1.1.0 / 2006-12-19
51
+ === 1.1.0 / 2006-12-19
44
52
 
45
53
  * 12 major enhancements:
46
54
  * Able to roll back original method after processing.
@@ -56,7 +64,7 @@
56
64
  * Can run against entire classes
57
65
  * Command line options!
58
66
 
59
- == 1.0.0 / 2006-10-22
67
+ === 1.0.0 / 2006-10-22
60
68
 
61
69
  * 1 major enhancement
62
70
  * Birthday!
data/Rakefile CHANGED
@@ -14,6 +14,8 @@ Hoe.new('heckle', Heckle::VERSION) do |p|
14
14
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
15
15
 
16
16
  p.extra_deps << ['ruby2ruby', '>= 1.1.0']
17
+ p.extra_deps << ['ZenTest', '>= 3.5.2']
18
+
17
19
  end
18
20
 
19
21
  # vim: syntax=Ruby
@@ -18,7 +18,7 @@ class Heckle < SexpProcessor
18
18
  ##
19
19
  # The version of Heckle you are using.
20
20
 
21
- VERSION = '1.4.0'
21
+ VERSION = '1.4.1'
22
22
 
23
23
  ##
24
24
  # Branch node types.
@@ -223,7 +223,13 @@ class Heckle < SexpProcessor
223
223
  out = [:call, recv, meth]
224
224
  out << args if args
225
225
 
226
- mutate_node out
226
+ stack = caller.map { |s| s[/process_\w+/] }.compact
227
+
228
+ if stack.first != "process_iter" then
229
+ mutate_node out
230
+ else
231
+ out
232
+ end
227
233
  end
228
234
 
229
235
  ##
@@ -245,6 +251,13 @@ class Heckle < SexpProcessor
245
251
  reset_node_count
246
252
  end
247
253
 
254
+ ##
255
+ # So process_call works correctly
256
+
257
+ def process_iter(exp)
258
+ [:iter, process(exp.shift), process(exp.shift), process(exp.shift)]
259
+ end
260
+
248
261
  def process_asgn(type, exp)
249
262
  var = exp.shift
250
263
  if exp.empty? then
@@ -97,8 +97,9 @@ class TestUnitHeckler < Heckle
97
97
  ARGV.clear
98
98
  ARGV << "--name=/#{name}/"
99
99
  end
100
- Test::Unit::AutoRunner.run
100
+ result = Test::Unit::AutoRunner.run
101
101
  ARGV.clear
102
+ result
102
103
  end
103
104
  end
104
105
  end
@@ -9,6 +9,10 @@ class Heckled
9
9
  some_func + some_other_func
10
10
  end
11
11
 
12
+ def uses_callblock
13
+ x.y { 1 }
14
+ end
15
+
12
16
  def uses_cvasgn
13
17
  @@cvar = 5
14
18
  @@cvar = nil
@@ -139,7 +143,7 @@ class Heckled
139
143
 
140
144
  def uses_nothing
141
145
  end
142
-
146
+
143
147
  def self.is_a_klass_method?
144
148
  true
145
149
  end
@@ -437,6 +437,26 @@ class TestHeckleCall < HeckleTestCase
437
437
 
438
438
  end
439
439
 
440
+ class TestHeckleCallblock < HeckleTestCase
441
+
442
+ def setup
443
+ @nodes = [:call]
444
+ super
445
+ end
446
+
447
+ def test_callblock_deleted
448
+ expected = [:defn, :uses_callblock,
449
+ [:scope,
450
+ [:block,
451
+ [:args],
452
+ [:iter, [:call, [:vcall, :x], :y], nil, [:lit, 1]]]]]
453
+
454
+ @heckler.process(@heckler.current_tree)
455
+ assert_equal expected, @heckler.current_tree
456
+ end
457
+
458
+ end
459
+
440
460
  class TestHeckleClassMethod < Test::Unit::TestCase
441
461
  def setup
442
462
  @heckler = TestHeckler.new("Heckled", "self.is_a_klass_method?")
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0.9
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: heckle
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.4.0
7
- date: 2007-05-18 00:00:00 -07:00
6
+ version: 1.4.1
7
+ date: 2007-06-05 00:00:00 -07:00
8
8
  summary: Unit Test Sadism
9
9
  require_paths:
10
10
  - lib
@@ -44,10 +44,13 @@ files:
44
44
  - test/test_heckle.rb
45
45
  test_files:
46
46
  - test/test_heckle.rb
47
- rdoc_options: []
48
-
49
- extra_rdoc_files: []
50
-
47
+ rdoc_options:
48
+ - --main
49
+ - README.txt
50
+ extra_rdoc_files:
51
+ - History.txt
52
+ - Manifest.txt
53
+ - README.txt
51
54
  executables:
52
55
  - heckle
53
56
  extensions: []
@@ -64,6 +67,15 @@ dependencies:
64
67
  - !ruby/object:Gem::Version
65
68
  version: 1.1.0
66
69
  version:
70
+ - !ruby/object:Gem::Dependency
71
+ name: ZenTest
72
+ version_requirement:
73
+ version_requirements: !ruby/object:Gem::Version::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 3.5.2
78
+ version:
67
79
  - !ruby/object:Gem::Dependency
68
80
  name: hoe
69
81
  version_requirement:
@@ -71,5 +83,5 @@ dependencies:
71
83
  requirements:
72
84
  - - ">="
73
85
  - !ruby/object:Gem::Version
74
- version: 1.2.0
86
+ version: 1.2.1
75
87
  version: