rcor 0.8.1 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile.rb +1 -1
- data/lib/concordion.rb +1 -8
- data/lib/concordion_constants.rb +1 -1
- data/lib/concordion_css.rb +8 -1
- data/lib/concordion_css_decorator.rb +21 -4
- data/lib/concordion_error_condition.rb +26 -0
- data/lib/concordion_invoker.rb +103 -9
- data/lib/concordion_parse_result.rb +19 -1
- data/lib/concordion_parser.rb +1 -1
- data/lib/concordion_processor.rb +3 -2
- data/lib/concordion_string_utility.rb +36 -2
- data/lib/concordion_test_case.rb +12 -62
- data/lib/concordion_test_methods.rb +127 -0
- data/lib/concordion_utility.rb +15 -3
- data/lib/goldmaster_test_case.rb +22 -5
- data/lib/loader_helper.rb +16 -0
- data/nbproject/private/private.xml +0 -6
- data/nbproject/private/rake-d.txt +13 -0
- data/tests/apostrophe.html +7 -0
- data/tests/apostrophe_test.rb +18 -0
- data/tests/ariel_example.html +13 -0
- data/tests/ariel_example_test.rb +36 -0
- data/tests/attr_assert.html +2 -0
- data/tests/basic_assert_true_test.rb +5 -1
- data/tests/basic_set.html +3 -0
- data/tests/basic_text.html +8 -0
- data/tests/basic_text_test.rb +11 -0
- data/tests/concordion_parse_result_test.rb +16 -1
- data/tests/concordion_test.rb +0 -14
- data/tests/concordion_utility_test.rb +44 -0
- data/tests/failing.html +4 -0
- data/tests/failing_test.rb +10 -2
- data/tests/goldmaster_assert_true_failing.html +5 -0
- data/tests/goldmaster_assert_true_failing_goldmaster.html +169 -0
- data/tests/goldmaster_assert_true_failing_test.rb +14 -0
- data/tests/goldmaster_failing.html +40 -0
- data/tests/goldmaster_failing_goldmaster.html +48 -1
- data/tests/goldmaster_failing_test.rb +28 -2
- data/tests/goldmaster_malformed.html +7 -0
- data/tests/goldmaster_malformed_goldmaster.html +171 -0
- data/tests/goldmaster_malformed_test.rb +11 -0
- data/tests/goldmaster_passing_goldmaster.html +8 -1
- data/tests/goldmaster_table_bug.html +12 -0
- data/tests/goldmaster_table_bug_goldmaster.html +176 -0
- data/tests/goldmaster_table_bug_test.rb +24 -0
- data/tests/goldmaster_table_goldmaster.html +8 -1
- data/tests/image.html +5 -0
- data/tests/image.jpg +0 -0
- data/tests/image_test.rb +9 -0
- data/tests/mixed.html +5 -0
- data/tests/mixed_test.rb +19 -0
- data/tests/no_parens.html +15 -0
- data/tests/no_parens_test.rb +20 -0
- data/tests/numbers.html +5 -0
- data/tests/numbers_test.rb +11 -0
- data/tests/verify_rows_scsr_test.rb +2 -0
- data/tests/verify_rows_simple.html +14 -0
- data/tests/verify_rows_simple_test.rb +17 -0
- metadata +31 -4
- data/lib/concordion_invocation_string_builder.rb +0 -24
@@ -33,7 +33,22 @@ class ConcordionUtilityTest < Test::Unit::TestCase
|
|
33
33
|
assert_equal "bob_case_goldmaster.html", snake_cased_goldmaster_name("BobCaseTest")
|
34
34
|
end
|
35
35
|
|
36
|
+
def test_conc_method_name_hard
|
37
|
+
assert_equal "greeting=", concordion_method_name("#result = greeting=(#TEXT)")
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_escapes_single_quotes
|
41
|
+
assert_equal "A\\\\'s", escape_single_quotes("A's")
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_conc_method_name_no_parens
|
45
|
+
assert_equal "invoke", concordion_method_name("invoke")
|
46
|
+
assert_equal "invoke", concordion_method_name("invoke #foo")
|
36
47
|
|
48
|
+
assert_equal "foo", concordion_method_name("#baz = foo #asdf, #fdsa")
|
49
|
+
assert_equal "greeting=", concordion_method_name("greeting= #TEXT")
|
50
|
+
end
|
51
|
+
|
37
52
|
def test_conc_method_name
|
38
53
|
assert_equal "invoke", concordion_method_name("invoke()")
|
39
54
|
assert_equal "invoke", concordion_method_name("invoke(")
|
@@ -41,25 +56,54 @@ class ConcordionUtilityTest < Test::Unit::TestCase
|
|
41
56
|
assert_equal "bleh", concordion_method_name("bleh(foo,bar)")
|
42
57
|
assert_equal "bleh", concordion_method_name("bleh ( foo , bar)")
|
43
58
|
assert_equal "foo", concordion_method_name("#baz = foo ( #asdf, #fdsa)")
|
59
|
+
assert_equal "greeting=", concordion_method_name("greeting=(#TEXT)")
|
44
60
|
end
|
45
61
|
|
62
|
+
def test_conc_var_name_no_parens
|
63
|
+
assert_equal "#result", concordion_variable_name("#result.first")
|
64
|
+
end
|
46
65
|
def test_conc_var_name
|
47
66
|
assert_equal "#result", concordion_variable_name("#result.first()")
|
48
67
|
assert_equal "#res", concordion_variable_name(" #res ")
|
49
68
|
|
50
69
|
end
|
51
70
|
|
71
|
+
def test_is_direct_method_call
|
72
|
+
assert is_direct_method_call?("invoke")
|
73
|
+
assert !is_direct_method_call?("invoke(#foo,#bar)")
|
74
|
+
|
75
|
+
end
|
76
|
+
def test_has_args_no_parens
|
77
|
+
assert !has_arguments?("invoke")
|
78
|
+
assert has_arguments?("invoke #foo")
|
79
|
+
assert has_arguments?("invoke #foo, #bar")
|
80
|
+
|
81
|
+
end
|
82
|
+
|
52
83
|
def test_has_args
|
53
84
|
assert has_arguments?("invoke(#foo,#bar)")
|
85
|
+
assert has_arguments?("invoke(#foo)")
|
54
86
|
assert !has_arguments?("invoke()")
|
55
87
|
end
|
56
88
|
|
89
|
+
def test_conc_args_no_parens
|
90
|
+
assert_equal [], concordion_arguments("invoke")
|
91
|
+
assert_equal ["#foo","#bar"], concordion_arguments("bleh #foo,#bar")
|
92
|
+
assert_equal ["#foo","#bar"], concordion_arguments("bleh #foo , #bar ")
|
93
|
+
assert_equal ["#foo","#bar"], concordion_arguments("#asdf = bleh #foo , #bar ")
|
94
|
+
|
95
|
+
end
|
57
96
|
def test_conc_args
|
58
97
|
assert_equal [], concordion_arguments("invoke()")
|
59
98
|
assert_equal ["#foo","#bar"], concordion_arguments("bleh(#foo,#bar)")
|
60
99
|
assert_equal ["#foo","#bar"], concordion_arguments("bleh ( #foo , #bar )")
|
100
|
+
assert_equal ["#foo","#bar"], concordion_arguments("#asdf = bleh ( #foo , #bar )")
|
61
101
|
end
|
62
102
|
|
103
|
+
def test_conc_assignment_no_parens
|
104
|
+
assert_equal "#foo", concordion_assignment(" #foo = getResult ")
|
105
|
+
end
|
106
|
+
|
63
107
|
def test_conc_assignment
|
64
108
|
assert_equal "#foo", concordion_assignment(" #foo = getResult() ")
|
65
109
|
assert_equal "#for", concordion_assignment("#for=")
|
data/tests/failing.html
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
<html xmlns:concordion="http://www.concordion.org/2007/concordion">
|
2
2
|
<body>
|
3
3
|
<p concordion:assertEquals="wrong_value()">right value</p>
|
4
|
+
<p concordion:assertEquals="wrong_value2()">right value</p>
|
5
|
+
<div>
|
6
|
+
<span concordion:assertEquals="wrong_value3()">right value</span>
|
7
|
+
</div>
|
4
8
|
</body>
|
5
9
|
</html>
|
data/tests/failing_test.rb
CHANGED
@@ -3,10 +3,18 @@ require 'concordion_test_case'
|
|
3
3
|
|
4
4
|
class FailingTest < ConcordionTestCase
|
5
5
|
|
6
|
-
def
|
7
|
-
|
6
|
+
def expected_failure_count
|
7
|
+
3
|
8
8
|
end
|
9
9
|
|
10
|
+
#TODO method_missing? => return "wrong" :)
|
11
|
+
def wrong_value4
|
12
|
+
"wrong"
|
13
|
+
end
|
14
|
+
|
15
|
+
def wrong_value2
|
16
|
+
"wrong"
|
17
|
+
end
|
10
18
|
def wrong_value
|
11
19
|
"wrong"
|
12
20
|
end
|
@@ -0,0 +1,169 @@
|
|
1
|
+
<html xmlns:concordion="http://www.concordion.org/2007/concordion"><head><style type="text/css">* {
|
2
|
+
font-family: Arial;
|
3
|
+
}
|
4
|
+
body {
|
5
|
+
padding: 32px;
|
6
|
+
}
|
7
|
+
pre {
|
8
|
+
padding: 6px 28px 6px 28px;
|
9
|
+
background-color: #E8EEF7;
|
10
|
+
}
|
11
|
+
pre, pre *, code, kbd {
|
12
|
+
font-family: Courier New, Courier;
|
13
|
+
font-size: 10pt;
|
14
|
+
}
|
15
|
+
h1, h1 * {
|
16
|
+
font-size: 24pt;
|
17
|
+
}
|
18
|
+
p, td, th, li, .breadcrumbs {
|
19
|
+
font-size: 10pt;
|
20
|
+
}
|
21
|
+
p, li {
|
22
|
+
line-height: 140%;
|
23
|
+
}
|
24
|
+
table {
|
25
|
+
border-collapse: collapse;
|
26
|
+
empty-cells: show;
|
27
|
+
margin: 8px 0px 8px 0px;
|
28
|
+
}
|
29
|
+
th, td {
|
30
|
+
border: 1px solid black;
|
31
|
+
padding: 3px;
|
32
|
+
}
|
33
|
+
td {
|
34
|
+
background-color: white;
|
35
|
+
vertical-align: top;
|
36
|
+
}
|
37
|
+
th {
|
38
|
+
background-color: #C3D9FF;
|
39
|
+
}
|
40
|
+
li {
|
41
|
+
margin-top: 6px;
|
42
|
+
margin-bottom: 6px;
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
.example {
|
47
|
+
padding: 2px 12px 6px 12px;
|
48
|
+
border: 1px solid #C3D9FF;
|
49
|
+
margin: 6px 0px 28px 0px;
|
50
|
+
background-color: #F5F9FD;
|
51
|
+
}
|
52
|
+
.example h3 {
|
53
|
+
margin-top: 8px;
|
54
|
+
margin-bottom: 8px;
|
55
|
+
font-size: 12pt;
|
56
|
+
}
|
57
|
+
|
58
|
+
p.success {
|
59
|
+
padding: 2px;
|
60
|
+
}
|
61
|
+
.concordion_success, .concordion_success * {
|
62
|
+
background-color: #afa;
|
63
|
+
}
|
64
|
+
.success pre {
|
65
|
+
background-color: #bbffbb;
|
66
|
+
}
|
67
|
+
.concordion_failure, .concordion_failure * {
|
68
|
+
background-color: #ffb0b0;
|
69
|
+
padding: 1px;
|
70
|
+
}
|
71
|
+
.concordion_failure .expected {
|
72
|
+
text-decoration: line-through;
|
73
|
+
color: #bb5050;
|
74
|
+
}
|
75
|
+
|
76
|
+
td.concordion_failure {
|
77
|
+
background-color: #ffb0b0 !important;
|
78
|
+
}
|
79
|
+
td.concordion_success {
|
80
|
+
background-color: #afa !important;
|
81
|
+
}
|
82
|
+
|
83
|
+
ins {
|
84
|
+
text-decoration: none;
|
85
|
+
}
|
86
|
+
|
87
|
+
.exceptionMessage {
|
88
|
+
background-color: #fdd;
|
89
|
+
font-family: Courier New, Courier, Monospace;
|
90
|
+
font-size: 10pt;
|
91
|
+
display: block;
|
92
|
+
font-weight: normal;
|
93
|
+
padding: 4px;
|
94
|
+
text-decoration: none !important;
|
95
|
+
}
|
96
|
+
.stackTrace, .stackTrace * {
|
97
|
+
font-weight: normal;
|
98
|
+
}
|
99
|
+
.stackTrace {
|
100
|
+
display: none;
|
101
|
+
padding: 1px 4px 4px 4px;
|
102
|
+
background-color: #fdd;
|
103
|
+
border-top: 1px dotted black;
|
104
|
+
}
|
105
|
+
.stackTraceExceptionMessage {
|
106
|
+
display: block;
|
107
|
+
font-family: Courier New, Courier, Monospace;
|
108
|
+
font-size: 8pt;
|
109
|
+
white-space: wrap;
|
110
|
+
padding: 1px 0px 1px 0px;
|
111
|
+
}
|
112
|
+
.stackTraceEntry {
|
113
|
+
white-space: nowrap;
|
114
|
+
font-family: Courier New, Courier, Monospace;
|
115
|
+
display: block;
|
116
|
+
font-size: 8pt;
|
117
|
+
padding: 1px 0px 1px 32px;
|
118
|
+
}
|
119
|
+
.stackTraceButton {
|
120
|
+
font-size: 8pt;
|
121
|
+
margin: 2px 8px 2px 0px;
|
122
|
+
font-weight: normal;
|
123
|
+
font-family: Arial;
|
124
|
+
}
|
125
|
+
|
126
|
+
.special {
|
127
|
+
font-style: italic;
|
128
|
+
}
|
129
|
+
.missing, .missing * {
|
130
|
+
background-color: #ff9999;
|
131
|
+
}
|
132
|
+
.surplus, .surplus * {
|
133
|
+
background-color: #ff9999;
|
134
|
+
}
|
135
|
+
.footer {
|
136
|
+
text-align: right;
|
137
|
+
margin-top: 40px;
|
138
|
+
font-size: 8pt;
|
139
|
+
width: 100%;
|
140
|
+
color: #999;
|
141
|
+
}
|
142
|
+
.footer .testTime {
|
143
|
+
padding: 2px 10px 0px 0px;
|
144
|
+
}
|
145
|
+
|
146
|
+
.idea {
|
147
|
+
font-size: 9pt;
|
148
|
+
color: #888;
|
149
|
+
font-style: italic;
|
150
|
+
}
|
151
|
+
.tight li {
|
152
|
+
margin-top: 1px;
|
153
|
+
margin-bottom: 1px;
|
154
|
+
}
|
155
|
+
.commentary {
|
156
|
+
float: right;
|
157
|
+
width: 200px;
|
158
|
+
background-color: #ffffd0;
|
159
|
+
padding:8px;
|
160
|
+
border: 3px solid #eeeeb0;
|
161
|
+
margin: 10px 0px 10px 10px;
|
162
|
+
}
|
163
|
+
.commentary, .commentary * {
|
164
|
+
font-size: 8pt;
|
165
|
+
}</style></head>
|
166
|
+
<body>
|
167
|
+
<p class="concordion_failure" concordion:asserttrue="getFalse()">Uh Oh: expected true but received false</p>
|
168
|
+
</body>
|
169
|
+
</html>
|
@@ -1,5 +1,45 @@
|
|
1
1
|
<html xmlns:concordion="http://www.concordion.org/2007/concordion">
|
2
2
|
<body>
|
3
3
|
<p concordion:assertEquals="getGreeting()">Hello World!</p>
|
4
|
+
<p concordion:assertEquals="no_such_method_in_fixture()">Thats ok, look how nice the error is.</p>
|
5
|
+
<table concordion:verifyRows="#plans = get_plans()">
|
6
|
+
<tr>
|
7
|
+
<th concordion:assertEquals="#plan.planName">Plan Name</th>
|
8
|
+
</tr>
|
9
|
+
<tr>
|
10
|
+
<td>Cunning Plan 1</td>
|
11
|
+
</tr>
|
12
|
+
<tr>
|
13
|
+
<td>Cunning Plan 2</td>
|
14
|
+
</tr>
|
15
|
+
</table>
|
16
|
+
<table concordion:verifyRows="#plans = get_3_plans()">
|
17
|
+
<tr>
|
18
|
+
<th concordion:assertEquals="#plan.planName">Plan Name</th>
|
19
|
+
</tr>
|
20
|
+
<tr>
|
21
|
+
<td>Cunning Plan A</td>
|
22
|
+
</tr>
|
23
|
+
</table>
|
24
|
+
<table concordion:verifyRows="#plans = get_plans()">
|
25
|
+
<tr>
|
26
|
+
<th concordion:assertEquals="#plan.planName">Plan Name</th>
|
27
|
+
</tr>
|
28
|
+
<tr>
|
29
|
+
<td>Cunning Plan 2</td>
|
30
|
+
</tr>
|
31
|
+
<tr>
|
32
|
+
<td>Cunning Plan 3</td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<td>Cunning Plan 4</td>
|
36
|
+
</tr>
|
37
|
+
<tr>
|
38
|
+
<td>Cunning Plan 5</td>
|
39
|
+
</tr>
|
40
|
+
<tr>
|
41
|
+
<td>Cunning Plan 6</td>
|
42
|
+
</tr>
|
43
|
+
</table>
|
4
44
|
</body>
|
5
45
|
</html>
|
@@ -59,7 +59,7 @@ p.success {
|
|
59
59
|
padding: 2px;
|
60
60
|
}
|
61
61
|
.concordion_success, .concordion_success * {
|
62
|
-
background-color: #afa
|
62
|
+
background-color: #afa;
|
63
63
|
}
|
64
64
|
.success pre {
|
65
65
|
background-color: #bbffbb;
|
@@ -73,6 +73,13 @@ p.success {
|
|
73
73
|
color: #bb5050;
|
74
74
|
}
|
75
75
|
|
76
|
+
td.concordion_failure {
|
77
|
+
background-color: #ffb0b0 !important;
|
78
|
+
}
|
79
|
+
td.concordion_success {
|
80
|
+
background-color: #afa !important;
|
81
|
+
}
|
82
|
+
|
76
83
|
ins {
|
77
84
|
text-decoration: none;
|
78
85
|
}
|
@@ -158,5 +165,45 @@ ins {
|
|
158
165
|
}</style></head>
|
159
166
|
<body>
|
160
167
|
<p concordion:assertequals="getGreeting()" class="concordion_failure">Hello World! expected but received Hello World?</p>
|
168
|
+
<p concordion:assertequals="no_such_method_in_fixture()" class="concordion_failure">Thats ok, look how nice the error is. expected but received [Missing method 'no_such_method_in_fixture' in fixture GoldmasterFailingTest ]</p>
|
169
|
+
<table class="concordion_success" concordion:verifyrows="#plans = get_plans()">
|
170
|
+
<tr>
|
171
|
+
<th concordion:assertequals="#plan.planName">Plan Name</th>
|
172
|
+
</tr>
|
173
|
+
<tr>
|
174
|
+
<td concordion:assertequals="#plan.planName" class="concordion_failure">Cunning Plan 1 expected but received Cunning Plan 2</td>
|
175
|
+
</tr>
|
176
|
+
<tr>
|
177
|
+
<td concordion:assertequals="#plan.planName" class="concordion_failure">Cunning Plan 2 expected but received Cunning Plan 3</td>
|
178
|
+
</tr>
|
179
|
+
</table>
|
180
|
+
<table class="concordion_failure" concordion:verifyrows="#plans = get_3_plans()">
|
181
|
+
<tr>
|
182
|
+
<th concordion:assertequals="#plan.planName">Plan Name</th>
|
183
|
+
</tr>
|
184
|
+
<tr>
|
185
|
+
<td concordion:assertequals="#plan.planName">Cunning Plan A</td>
|
186
|
+
</tr>
|
187
|
+
<tr><td concordion:assertequals="#plan.planName">[2 Surplus Row(s) Returned By Fixture]</td></tr></table>
|
188
|
+
<table class="concordion_failure" concordion:verifyrows="#plans = get_plans()">
|
189
|
+
<tr>
|
190
|
+
<th concordion:assertequals="#plan.planName">Plan Name</th>
|
191
|
+
</tr>
|
192
|
+
<tr>
|
193
|
+
<td concordion:assertequals="#plan.planName" class="concordion_success">Cunning Plan 2</td>
|
194
|
+
</tr>
|
195
|
+
<tr>
|
196
|
+
<td concordion:assertequals="#plan.planName" class="concordion_success">Cunning Plan 3</td>
|
197
|
+
</tr>
|
198
|
+
<tr>
|
199
|
+
<td concordion:assertequals="#plan.planName" class="concordion_failure">Cunning Plan 4 expected but received [No more rows]</td>
|
200
|
+
</tr>
|
201
|
+
<tr>
|
202
|
+
<td concordion:assertequals="#plan.planName" class="concordion_failure">Cunning Plan 5 expected but received [No more rows]</td>
|
203
|
+
</tr>
|
204
|
+
<tr>
|
205
|
+
<td concordion:assertequals="#plan.planName" class="concordion_failure">Cunning Plan 6 expected but received [No more rows]</td>
|
206
|
+
</tr>
|
207
|
+
</table>
|
161
208
|
</body>
|
162
209
|
</html>
|
@@ -1,11 +1,37 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'goldmaster_test_case'
|
3
3
|
|
4
|
+
require 'mocha'
|
5
|
+
|
4
6
|
class GoldmasterFailingTest < GoldmasterTestCase
|
5
|
-
def
|
6
|
-
|
7
|
+
def expected_failure_count
|
8
|
+
9
|
7
9
|
end
|
10
|
+
|
8
11
|
def getGreeting
|
9
12
|
"Hello World?"
|
10
13
|
end
|
14
|
+
|
15
|
+
def get_3_plans
|
16
|
+
plans = []
|
17
|
+
plans << mock_plan_named("Cunning Plan A")
|
18
|
+
plans << mock_plan_named("Cunning Plan B")
|
19
|
+
plans << mock_plan_named("Cunning Plan C")
|
20
|
+
plans
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_plans
|
25
|
+
plans = []
|
26
|
+
plans << mock_plan_named("Cunning Plan 2")
|
27
|
+
plans << mock_plan_named("Cunning Plan 3")
|
28
|
+
plans
|
29
|
+
end
|
30
|
+
|
31
|
+
def mock_plan_named(name)
|
32
|
+
plan = mock("plan")
|
33
|
+
plan.stubs(:planName).returns name
|
34
|
+
plan
|
35
|
+
end
|
11
36
|
end
|
37
|
+
|