heckle 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +12 -0
- data/Manifest.txt +0 -2
- data/bin/heckle +21 -2
- data/lib/heckle.rb +441 -2
- data/lib/test_unit_heckler.rb +30 -20
- data/sample/lib/heckled.rb +13 -0
- data/sample/test/test_heckled.rb +8 -0
- data/test/fixtures/heckled.rb +21 -17
- data/test/test_heckle.rb +221 -466
- metadata +7 -9
- data/lib/heckle/base.rb +0 -352
- data/lib/heckle/reporter.rb +0 -43
data/test/fixtures/heckled.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
class Heckled
|
2
2
|
attr_accessor :names
|
3
|
-
|
3
|
+
|
4
4
|
def initialize
|
5
5
|
@names = []
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
def uses_many_things
|
9
9
|
i = 1
|
10
10
|
while i < 10
|
@@ -14,10 +14,10 @@ class Heckled
|
|
14
14
|
end
|
15
15
|
return true if "hi there" == "changeling"
|
16
16
|
return false
|
17
|
-
end
|
17
|
+
end
|
18
18
|
i
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def uses_while
|
22
22
|
while some_func
|
23
23
|
some_other_func
|
@@ -29,31 +29,31 @@ class Heckled
|
|
29
29
|
some_other_func
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def uses_numeric_literals
|
34
34
|
i = 1
|
35
35
|
i += 2147483648
|
36
36
|
i -= 3.5
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def uses_strings
|
40
40
|
@names << "Hello, Robert"
|
41
41
|
@names << "Hello, Jeff"
|
42
42
|
@names << "Hi, Frank"
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def uses_different_types
|
46
46
|
i = 1
|
47
47
|
b = "Hello, Joe"
|
48
48
|
c = 3.3
|
49
49
|
end
|
50
|
-
|
51
|
-
def
|
50
|
+
|
51
|
+
def uses_same_literal
|
52
52
|
i = 1
|
53
53
|
i = 1
|
54
54
|
i = 1
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
def uses_if
|
58
58
|
if some_func
|
59
59
|
if some_other_func
|
@@ -61,12 +61,12 @@ class Heckled
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def uses_boolean
|
66
66
|
a = true
|
67
67
|
b = false
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def uses_unless
|
71
71
|
unless true
|
72
72
|
if false
|
@@ -74,30 +74,34 @@ class Heckled
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
def uses_symbols
|
79
79
|
i = :blah
|
80
80
|
i = :blah
|
81
81
|
i = :and_blah
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
def uses_regexes
|
85
85
|
i = /a.*/
|
86
86
|
i = /c{2,4}+/
|
87
87
|
i = /123/
|
88
88
|
end
|
89
|
-
|
89
|
+
|
90
90
|
def uses_ranges
|
91
91
|
i = 6..100
|
92
92
|
i = -1..9
|
93
93
|
i = 1..4
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
def uses_nothing
|
97
97
|
end
|
98
98
|
|
99
|
+
def self.is_a_klass_method?
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
99
103
|
private
|
100
|
-
|
104
|
+
|
101
105
|
def some_func; end
|
102
106
|
def some_other_func; end
|
103
107
|
end
|