concordion 0.9.9.2 → 0.9.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. data/README +0 -0
  2. data/Rakefile.rb +25 -28
  3. data/documentation/index.html +88 -0
  4. data/documentation/p/rcor/wiki/Tutorial/index.html +75 -0
  5. data/lib/concordion/binder.rb +26 -0
  6. data/lib/concordion/constants.rb +15 -0
  7. data/lib/{concordion_css.rb → concordion/css.rb} +9 -7
  8. data/lib/concordion/css_decorator.rb +59 -0
  9. data/lib/concordion/environment.rb +28 -0
  10. data/lib/concordion/error_condition.rb +27 -0
  11. data/lib/concordion/instrumenter.rb +31 -0
  12. data/lib/concordion/invoker.rb +148 -0
  13. data/lib/concordion/loader_helper.rb +17 -0
  14. data/lib/concordion/lookahead_handler.rb +16 -0
  15. data/lib/concordion/parse_result.rb +74 -0
  16. data/lib/concordion/parser.rb +43 -0
  17. data/lib/concordion/processor.rb +24 -0
  18. data/lib/concordion/reader.rb +11 -0
  19. data/lib/concordion/state.rb +77 -0
  20. data/lib/concordion/string_utility.rb +104 -0
  21. data/lib/concordion/string_writer.rb +13 -0
  22. data/lib/concordion/test_methods.rb +130 -0
  23. data/lib/concordion/utility.rb +72 -0
  24. data/lib/concordion/verifier.rb +52 -0
  25. data/lib/concordion/writer.rb +52 -0
  26. data/lib/concordion_test_case.rb +4 -16
  27. data/lib/goldmaster_test_case.rb +4 -4
  28. data/ruby-concordion.tmproj +249 -0
  29. data/test/concordion/css_decorator_test.rb +28 -0
  30. data/test/concordion/environment_test.rb +46 -0
  31. data/test/concordion/invoker_test.rb +20 -0
  32. data/test/concordion/parse_result_test.rb +51 -0
  33. data/test/concordion/reader_test.rb +12 -0
  34. data/test/concordion/state_test.rb +41 -0
  35. data/test/concordion/string_writer_test.rb +10 -0
  36. data/test/concordion/utility_test.rb +142 -0
  37. data/test/concordion/verifier_test.rb +38 -0
  38. data/test/concordion/writer_test.rb +29 -0
  39. data/{tests → test}/concordion.css +0 -0
  40. data/{tests/concordion → test}/goldmaster_test_case_test.rb +2 -8
  41. data/{tests → test/spec}/basic_assert.html +0 -0
  42. data/{tests → test/spec}/basic_assert_test.rb +2 -2
  43. data/{tests → test/spec}/basic_set.html +0 -0
  44. data/{tests → test/spec}/basic_set_test.rb +0 -1
  45. data/{tests → test/spec}/basic_text.html +0 -0
  46. data/{tests → test/spec}/basic_text_test.rb +0 -1
  47. data/{tests → test/spec}/failing.html +0 -0
  48. data/{tests → test/spec}/failing_test.rb +0 -1
  49. data/{tests → test/spec}/goldmasters/failing_with_subclass.html +0 -0
  50. data/{tests → test/spec}/goldmasters/failing_with_subclass_goldmaster.html +0 -0
  51. data/{tests → test/spec}/goldmasters/failing_with_subclass_test.rb +2 -2
  52. data/{tests → test/spec}/goldmasters/goldmaster_assert_true_failing.html +0 -0
  53. data/{tests → test/spec}/goldmasters/goldmaster_assert_true_failing_goldmaster.html +0 -0
  54. data/{tests → test/spec}/goldmasters/goldmaster_assert_true_failing_test.rb +0 -0
  55. data/{tests → test/spec}/goldmasters/goldmaster_failing.html +0 -0
  56. data/{tests → test/spec}/goldmasters/goldmaster_failing_goldmaster.html +0 -0
  57. data/{tests → test/spec}/goldmasters/goldmaster_failing_test.rb +0 -2
  58. data/{tests → test/spec}/goldmasters/goldmaster_malformed.html +0 -0
  59. data/{tests → test/spec}/goldmasters/goldmaster_malformed_goldmaster.html +0 -0
  60. data/{tests → test/spec}/goldmasters/goldmaster_malformed_test.rb +0 -0
  61. data/{tests → test/spec}/goldmasters/goldmaster_passing.html +0 -0
  62. data/{tests → test/spec}/goldmasters/goldmaster_passing_goldmaster.html +0 -0
  63. data/{tests → test/spec}/goldmasters/goldmaster_passing_test.rb +0 -0
  64. data/{tests → test/spec}/goldmasters/goldmaster_table.html +0 -0
  65. data/{tests → test/spec}/goldmasters/goldmaster_table_bug.html +0 -0
  66. data/{tests → test/spec}/goldmasters/goldmaster_table_bug_goldmaster.html +0 -0
  67. data/{tests → test/spec}/goldmasters/goldmaster_table_bug_test.rb +0 -0
  68. data/{tests → test/spec}/goldmasters/goldmaster_table_goldmaster.html +0 -0
  69. data/{tests → test/spec}/goldmasters/goldmaster_table_test.rb +1 -0
  70. data/{tests → test/spec}/image.html +0 -0
  71. data/{tests → test/spec}/image.jpg +0 -0
  72. data/{tests → test/spec}/image_test.rb +2 -2
  73. data/{tests → test/spec}/link_style_css.html +0 -0
  74. data/{tests → test/spec}/link_style_css_test.rb +1 -6
  75. data/{tests → test/spec}/lookahead_assert_true.html +0 -0
  76. data/{tests → test/spec}/lookahead_assert_true_test.rb +0 -0
  77. data/{tests → test/spec}/mixed.html +0 -0
  78. data/test/spec/mixed_test.rb +13 -0
  79. data/{tests → test/spec}/nested_element_lookahead.html +0 -0
  80. data/{tests → test/spec}/nested_element_lookahead_test.rb +0 -0
  81. data/{tests → test/spec}/numbers.html +0 -0
  82. data/{tests → test/spec}/numbers_test.rb +0 -0
  83. data/{tests → test/spec}/processes_elements_in_sorted_order.html +0 -0
  84. data/{tests → test/spec}/processes_elements_in_sorted_order_test.rb +0 -0
  85. data/{tests → test/spec}/return_result.html +0 -0
  86. data/{tests → test/spec}/return_result_test.rb +0 -0
  87. data/test/spec/structure/maps_to_module.html +11 -0
  88. data/test/spec/structure/maps_to_module_test.rb +13 -0
  89. data/{tests → test/spec}/tables/single_row_table.html +0 -0
  90. data/{tests → test/spec}/tables/single_row_table_test.rb +0 -0
  91. data/{tests → test/spec}/tables/table.html +0 -0
  92. data/{tests → test/spec}/tables/table_test.rb +1 -0
  93. data/{tests → test/spec}/tables/test_helper.rb +3 -7
  94. data/{tests → test/spec}/tables/verify_rows.html +0 -0
  95. data/{tests → test/spec}/tables/verify_rows_scsr.html +0 -0
  96. data/{tests → test/spec}/tables/verify_rows_scsr_test.rb +2 -1
  97. data/{tests → test/spec}/tables/verify_rows_simple.html +0 -0
  98. data/{tests → test/spec}/tables/verify_rows_simple_test.rb +0 -0
  99. data/{tests → test/spec}/tables/verify_rows_test.rb +1 -0
  100. data/{tests → test/spec}/user-reported/apostrophe.html +0 -0
  101. data/{tests → test/spec}/user-reported/apostrophe_test.rb +0 -1
  102. data/{tests → test/spec}/user-reported/ariel_example.html +0 -0
  103. data/{tests → test/spec}/user-reported/ariel_example_test.rb +0 -0
  104. data/{tests → test/spec}/user-reported/attr_assert.html +0 -0
  105. data/{tests → test/spec}/user-reported/attr_assert_test.rb +0 -1
  106. data/{tests → test/spec}/user-reported/basic_assert_true.html +0 -0
  107. data/{tests → test/spec}/user-reported/basic_assert_true_test.rb +1 -2
  108. data/{tests → test/spec}/user-reported/rubyish.html +0 -0
  109. data/{tests → test/spec}/user-reported/rubyish_test.rb +0 -1
  110. data/test/test_helper.rb +11 -0
  111. metadata +131 -114
  112. data/lib/concordion_binder.rb +0 -24
  113. data/lib/concordion_constants.rb +0 -13
  114. data/lib/concordion_css_decorator.rb +0 -58
  115. data/lib/concordion_environment.rb +0 -27
  116. data/lib/concordion_error_condition.rb +0 -26
  117. data/lib/concordion_instrumenter.rb +0 -30
  118. data/lib/concordion_invoker.rb +0 -137
  119. data/lib/concordion_lookahead_handler.rb +0 -17
  120. data/lib/concordion_parse_result.rb +0 -72
  121. data/lib/concordion_parser.rb +0 -47
  122. data/lib/concordion_processor.rb +0 -25
  123. data/lib/concordion_reader.rb +0 -10
  124. data/lib/concordion_state.rb +0 -78
  125. data/lib/concordion_string_utility.rb +0 -97
  126. data/lib/concordion_string_writer.rb +0 -13
  127. data/lib/concordion_test_methods.rb +0 -132
  128. data/lib/concordion_utility.rb +0 -70
  129. data/lib/concordion_verifier.rb +0 -50
  130. data/lib/concordion_writer.rb +0 -43
  131. data/lib/loader_helper.rb +0 -16
  132. data/tests/concordion/concordion_css_decorator_test.rb +0 -28
  133. data/tests/concordion/concordion_environment_test.rb +0 -44
  134. data/tests/concordion/concordion_parse_result_test.rb +0 -51
  135. data/tests/concordion/concordion_reader_test.rb +0 -15
  136. data/tests/concordion/concordion_state_test.rb +0 -38
  137. data/tests/concordion/concordion_string_writer_test.rb +0 -13
  138. data/tests/concordion/concordion_utility_test.rb +0 -135
  139. data/tests/concordion/concordion_verifier_test.rb +0 -38
  140. data/tests/concordion/concordion_writer_test.rb +0 -26
  141. data/tests/mixed_test.rb +0 -19
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concordion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9.2
4
+ version: 0.9.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Goodspeed
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-07 00:00:00 -04:00
12
+ date: 2009-04-15 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -41,125 +41,142 @@ extensions: []
41
41
  extra_rdoc_files: []
42
42
 
43
43
  files:
44
- - test-lib
45
- - test-lib/single_row_result.rb
46
- - test-lib/user.rb
47
- - Rakefile.rb
48
- - tests
49
- - tests/link_style_css_test.rb
50
- - tests/concordion
51
- - tests/concordion/concordion_utility_test.rb
52
- - tests/concordion/goldmaster_test_case_test.rb
53
- - tests/concordion/concordion_string_writer_test.rb
54
- - tests/concordion/concordion_writer_test.rb
55
- - tests/concordion/concordion_reader_test.rb
56
- - tests/concordion/concordion_verifier_test.rb
57
- - tests/concordion/concordion_state_test.rb
58
- - tests/concordion/concordion_parse_result_test.rb
59
- - tests/concordion/concordion_css_decorator_test.rb
60
- - tests/concordion/concordion_environment_test.rb
61
- - tests/concordion.css
62
- - tests/basic_assert.html
63
- - tests/lookahead_assert_true_test.rb
64
- - tests/mixed_test.rb
65
- - tests/failing.html
66
- - tests/numbers_test.rb
67
- - tests/mixed.html
68
- - tests/user-reported
69
- - tests/user-reported/basic_assert_true.html
70
- - tests/user-reported/apostrophe_test.rb
71
- - tests/user-reported/apostrophe.html
72
- - tests/user-reported/attr_assert.html
73
- - tests/user-reported/rubyish_test.rb
74
- - tests/user-reported/ariel_example_test.rb
75
- - tests/user-reported/rubyish.html
76
- - tests/user-reported/ariel_example.html
77
- - tests/user-reported/basic_assert_true_test.rb
78
- - tests/user-reported/attr_assert_test.rb
79
- - tests/basic_set_test.rb
80
- - tests/lookahead_assert_true.html
81
- - tests/basic_text.html
82
- - tests/processes_elements_in_sorted_order_test.rb
83
- - tests/return_result_test.rb
84
- - tests/nested_element_lookahead.html
85
- - tests/nested_element_lookahead_test.rb
86
- - tests/image_test.rb
87
- - tests/basic_set.html
88
- - tests/failing_test.rb
89
- - tests/return_result.html
90
- - tests/processes_elements_in_sorted_order.html
91
- - tests/image.jpg
92
- - tests/basic_text_test.rb
93
- - tests/numbers.html
94
- - tests/link_style_css.html
95
- - tests/tables
96
- - tests/tables/verify_rows.html
97
- - tests/tables/verify_rows_simple.html
98
- - tests/tables/table.html
99
- - tests/tables/test_helper.rb
100
- - tests/tables/verify_rows_scsr.html
101
- - tests/tables/single_row_table.html
102
- - tests/tables/verify_rows_simple_test.rb
103
- - tests/tables/verify_rows_scsr_test.rb
104
- - tests/tables/verify_rows_test.rb
105
- - tests/tables/single_row_table_test.rb
106
- - tests/tables/table_test.rb
107
- - tests/image.html
108
- - tests/goldmasters
109
- - tests/goldmasters/goldmaster_malformed.html
110
- - tests/goldmasters/goldmaster_passing_test.rb
111
- - tests/goldmasters/goldmaster_passing.html
112
- - tests/goldmasters/goldmaster_malformed_test.rb
113
- - tests/goldmasters/failing_with_subclass.html
114
- - tests/goldmasters/goldmaster_table_bug.html
115
- - tests/goldmasters/goldmaster_assert_true_failing_test.rb
116
- - tests/goldmasters/goldmaster_table_bug_test.rb
117
- - tests/goldmasters/goldmaster_failing_test.rb
118
- - tests/goldmasters/goldmaster_table_test.rb
119
- - tests/goldmasters/goldmaster_failing.html
120
- - tests/goldmasters/failing_with_subclass_test.rb
121
- - tests/goldmasters/goldmaster_failing_goldmaster.html
122
- - tests/goldmasters/goldmaster_assert_true_failing.html
123
- - tests/goldmasters/failing_with_subclass_goldmaster.html
124
- - tests/goldmasters/goldmaster_passing_goldmaster.html
125
- - tests/goldmasters/goldmaster_table_bug_goldmaster.html
126
- - tests/goldmasters/goldmaster_table_goldmaster.html
127
- - tests/goldmasters/goldmaster_assert_true_failing_goldmaster.html
128
- - tests/goldmasters/goldmaster_table.html
129
- - tests/goldmasters/goldmaster_malformed_goldmaster.html
130
- - tests/basic_assert_test.rb
44
+ - documentation
45
+ - documentation/index.html
46
+ - documentation/p
47
+ - documentation/p/rcor
48
+ - documentation/p/rcor/wiki
49
+ - documentation/p/rcor/wiki/Tutorial
50
+ - documentation/p/rcor/wiki/Tutorial/index.html
131
51
  - lib
52
+ - lib/concordion
53
+ - lib/concordion/binder.rb
54
+ - lib/concordion/constants.rb
55
+ - lib/concordion/css.rb
56
+ - lib/concordion/css_decorator.rb
57
+ - lib/concordion/environment.rb
58
+ - lib/concordion/error_condition.rb
59
+ - lib/concordion/instrumenter.rb
60
+ - lib/concordion/invoker.rb
61
+ - lib/concordion/loader_helper.rb
62
+ - lib/concordion/lookahead_handler.rb
63
+ - lib/concordion/parse_result.rb
64
+ - lib/concordion/parser.rb
65
+ - lib/concordion/processor.rb
66
+ - lib/concordion/reader.rb
67
+ - lib/concordion/state.rb
68
+ - lib/concordion/string_utility.rb
69
+ - lib/concordion/string_writer.rb
70
+ - lib/concordion/test_methods.rb
71
+ - lib/concordion/utility.rb
72
+ - lib/concordion/verifier.rb
73
+ - lib/concordion/writer.rb
132
74
  - lib/concordion.rb
133
- - lib/concordion_error_condition.rb
134
- - lib/rcor.rb
135
- - lib/goldmaster_test_case.rb
136
- - lib/concordion_parse_result.rb
137
- - lib/concordion_processor.rb
138
- - lib/concordion_string_writer.rb
139
- - lib/concordion_instrumenter.rb
140
- - lib/concordion_test_methods.rb
141
- - lib/concordion_lookahead_handler.rb
142
- - lib/concordion_invoker.rb
143
- - lib/loader_helper.rb
144
- - lib/concordion_environment.rb
145
- - lib/concordion_verifier.rb
146
- - lib/concordion_parser.rb
147
- - lib/concordion_reader.rb
148
- - lib/concordion_binder.rb
149
- - lib/concordion_css.rb
150
- - lib/concordion_state.rb
151
- - lib/concordion_css_decorator.rb
152
- - lib/concordion_writer.rb
153
- - lib/concordion_constants.rb
154
- - lib/concordion_utility.rb
155
75
  - lib/concordion_test_case.rb
156
- - lib/concordion_string_utility.rb
76
+ - lib/goldmaster_test_case.rb
77
+ - lib/rcor.rb
157
78
  - nbproject
158
- - nbproject/project.xml
159
- - nbproject/project.properties
160
79
  - nbproject/private
161
80
  - nbproject/private/private.properties
162
81
  - nbproject/private/rake-d.txt
82
+ - nbproject/project.properties
83
+ - nbproject/project.xml
84
+ - Rakefile.rb
85
+ - README
86
+ - ruby-concordion.tmproj
87
+ - spec-output
88
+ - test
89
+ - test/concordion
90
+ - test/concordion/css_decorator_test.rb
91
+ - test/concordion/environment_test.rb
92
+ - test/concordion/invoker_test.rb
93
+ - test/concordion/parse_result_test.rb
94
+ - test/concordion/reader_test.rb
95
+ - test/concordion/state_test.rb
96
+ - test/concordion/string_writer_test.rb
97
+ - test/concordion/utility_test.rb
98
+ - test/concordion/verifier_test.rb
99
+ - test/concordion/writer_test.rb
100
+ - test/concordion.css
101
+ - test/goldmaster_test_case_test.rb
102
+ - test/spec
103
+ - test/spec/basic_assert.html
104
+ - test/spec/basic_assert_test.rb
105
+ - test/spec/basic_set.html
106
+ - test/spec/basic_set_test.rb
107
+ - test/spec/basic_text.html
108
+ - test/spec/basic_text_test.rb
109
+ - test/spec/failing.html
110
+ - test/spec/failing_test.rb
111
+ - test/spec/goldmasters
112
+ - test/spec/goldmasters/failing_with_subclass.html
113
+ - test/spec/goldmasters/failing_with_subclass_goldmaster.html
114
+ - test/spec/goldmasters/failing_with_subclass_test.rb
115
+ - test/spec/goldmasters/goldmaster_assert_true_failing.html
116
+ - test/spec/goldmasters/goldmaster_assert_true_failing_goldmaster.html
117
+ - test/spec/goldmasters/goldmaster_assert_true_failing_test.rb
118
+ - test/spec/goldmasters/goldmaster_failing.html
119
+ - test/spec/goldmasters/goldmaster_failing_goldmaster.html
120
+ - test/spec/goldmasters/goldmaster_failing_test.rb
121
+ - test/spec/goldmasters/goldmaster_malformed.html
122
+ - test/spec/goldmasters/goldmaster_malformed_goldmaster.html
123
+ - test/spec/goldmasters/goldmaster_malformed_test.rb
124
+ - test/spec/goldmasters/goldmaster_passing.html
125
+ - test/spec/goldmasters/goldmaster_passing_goldmaster.html
126
+ - test/spec/goldmasters/goldmaster_passing_test.rb
127
+ - test/spec/goldmasters/goldmaster_table.html
128
+ - test/spec/goldmasters/goldmaster_table_bug.html
129
+ - test/spec/goldmasters/goldmaster_table_bug_goldmaster.html
130
+ - test/spec/goldmasters/goldmaster_table_bug_test.rb
131
+ - test/spec/goldmasters/goldmaster_table_goldmaster.html
132
+ - test/spec/goldmasters/goldmaster_table_test.rb
133
+ - test/spec/image.html
134
+ - test/spec/image.jpg
135
+ - test/spec/image_test.rb
136
+ - test/spec/link_style_css.html
137
+ - test/spec/link_style_css_test.rb
138
+ - test/spec/lookahead_assert_true.html
139
+ - test/spec/lookahead_assert_true_test.rb
140
+ - test/spec/mixed.html
141
+ - test/spec/mixed_test.rb
142
+ - test/spec/nested_element_lookahead.html
143
+ - test/spec/nested_element_lookahead_test.rb
144
+ - test/spec/numbers.html
145
+ - test/spec/numbers_test.rb
146
+ - test/spec/processes_elements_in_sorted_order.html
147
+ - test/spec/processes_elements_in_sorted_order_test.rb
148
+ - test/spec/return_result.html
149
+ - test/spec/return_result_test.rb
150
+ - test/spec/structure
151
+ - test/spec/structure/maps_to_module.html
152
+ - test/spec/structure/maps_to_module_test.rb
153
+ - test/spec/tables
154
+ - test/spec/tables/single_row_table.html
155
+ - test/spec/tables/single_row_table_test.rb
156
+ - test/spec/tables/table.html
157
+ - test/spec/tables/table_test.rb
158
+ - test/spec/tables/test_helper.rb
159
+ - test/spec/tables/verify_rows.html
160
+ - test/spec/tables/verify_rows_scsr.html
161
+ - test/spec/tables/verify_rows_scsr_test.rb
162
+ - test/spec/tables/verify_rows_simple.html
163
+ - test/spec/tables/verify_rows_simple_test.rb
164
+ - test/spec/tables/verify_rows_test.rb
165
+ - test/spec/user-reported
166
+ - test/spec/user-reported/apostrophe.html
167
+ - test/spec/user-reported/apostrophe_test.rb
168
+ - test/spec/user-reported/ariel_example.html
169
+ - test/spec/user-reported/ariel_example_test.rb
170
+ - test/spec/user-reported/attr_assert.html
171
+ - test/spec/user-reported/attr_assert_test.rb
172
+ - test/spec/user-reported/basic_assert_true.html
173
+ - test/spec/user-reported/basic_assert_true_test.rb
174
+ - test/spec/user-reported/rubyish.html
175
+ - test/spec/user-reported/rubyish_test.rb
176
+ - test/test_helper.rb
177
+ - test-lib
178
+ - test-lib/single_row_result.rb
179
+ - test-lib/user.rb
163
180
  has_rdoc: true
164
181
  homepage: http://ruby-concordion.rubyforge.org'
165
182
  post_install_message:
@@ -1,24 +0,0 @@
1
- require 'concordion_utility'
2
-
3
- class ConcordionBinder
4
- include ConcordionUtility
5
-
6
- def initialize(concordion)
7
- @concordion = concordion
8
- end
9
- def bind_if_set_command(cpr)
10
- if cpr.is_set_command?
11
- @concordion.set_variable(cpr.system_under_test, cpr.content)
12
- true
13
- else
14
- false
15
- end
16
- end
17
-
18
- def handle_assignment(cpr, sut_rv)
19
- if has_assignment?(cpr.system_under_test)
20
- @concordion.set_variable(concordion_assignment(cpr.system_under_test), sut_rv)
21
- end
22
- end
23
-
24
- end
@@ -1,13 +0,0 @@
1
- module ConcordionConstants
2
-
3
- def concordion_command_attributes
4
- ["assertequals", "set", "execute", "verifyrows", "asserttrue", "assert_image"].collect do
5
- |cmd| "concordion:#{cmd}"
6
- end
7
- end
8
-
9
- def supported?(tagname)
10
- ['p', 'span', 'b', 'th', 'tr', 'div'].include?(tagname.downcase)
11
- end
12
-
13
- end
@@ -1,58 +0,0 @@
1
- require 'concordion_css'
2
- require 'concordion_error_condition'
3
-
4
- class ConcordionCSSDecorator
5
-
6
-
7
- def add_concordion_css_link(root, html, type)
8
- if html.at("head").nil?
9
- root.search("html").prepend('<head></head>')
10
- end
11
- if type == :link
12
- link_to_css(html)
13
- else
14
- inline_css(html)
15
- end
16
- end
17
-
18
- def append_to_head(html, s)
19
- html.search("head").append(s)
20
- end
21
- def link_to_css(html)
22
- append_to_head(html, "<link rel='stylesheet' type='text/css' href='#{css_filename}' />")
23
- end
24
-
25
-
26
- def inline_css(html)
27
- append_to_head(html, "<style type='text/css'>#{css}</style>")
28
- end
29
-
30
- def css
31
- ConcordionCSS.css_string
32
- end
33
-
34
- def css_filename
35
- ConcordionCSS.css_filename
36
- end
37
-
38
- def add_css_file_to_output_dir(writer, type)
39
- if !writer.output_file_exists?(css_filename) && type == :link
40
- writer.calculate_filename_and_overwrite(css, css_filename)
41
- end
42
- end
43
-
44
- def decorate_tag(rv, tag, cpr)
45
- context = tag.to_html
46
- expected = tag.inner_html
47
- xpath = tag.xpath
48
-
49
- if rv[:result]
50
- tag[:class] = 'concordion_success'
51
- return nil
52
- end
53
-
54
- tag[:class] = 'concordion_failure'
55
- cpr.attribute_error(rv[:actual], rv[:expected])
56
- ConcordionErrorCondition.new(expected, rv[:actual], xpath, context, cpr.is_assert_true_command?)
57
- end
58
- end
@@ -1,27 +0,0 @@
1
-
2
- class ConcordionEnvironment
3
- def self.output_dir_key
4
- 'RCOR_OUTPUT_DIR'
5
- end
6
-
7
- def self.css_type_key
8
- 'RCOR_CSS_TYPE'
9
- end
10
-
11
- def self.with_dir(str)
12
- File.join(output_dir, str)
13
- end
14
- def self.clean_list
15
- [with_dir("*_test_output.html"), with_dir("concordion.css")] #TODO is this safe to delete? what if the user overwrites this file?
16
- end
17
-
18
- def self.css_type
19
- type = ENV[css_type_key]
20
- type.nil? ? :inline : type.to_sym
21
- end
22
-
23
- def self.output_dir
24
- dir = ENV[output_dir_key]
25
- dir.nil? ? "." : dir
26
- end
27
- end
@@ -1,26 +0,0 @@
1
- #
2
- # To change this template, choose Tools | Templates
3
- # and open the template in the editor.
4
-
5
-
6
- class ConcordionErrorCondition
7
- attr_reader :expected, :actual
8
- def initialize(expected, actual, xpath, context = nil, assert_true_command = false)
9
- @expected = expected
10
- @actual = actual
11
- @xpath = xpath
12
- @context = context
13
- @assert_true_command = assert_true_command
14
- end
15
-
16
- def to_s
17
- @expected = "true" if @assert_true_command
18
-
19
- base = "expected (#{@expected}) but got (#{@actual}) in tag: #{@xpath}"
20
-
21
-
22
- return base if @context.nil?
23
-
24
- base + "\n\tcontext of error: #{@context}"
25
- end
26
- end
@@ -1,30 +0,0 @@
1
-
2
- class ConcordionInstrumenter
3
- @@TH_CSS_QUERY_REGEXP = /tr:nth\(\d+\) > th:nth\((\d+)\)$/
4
- @@TH_CSS_SINGLE_REGEXP = /tr:nth\(\d+\) > th$/
5
-
6
- def instrument_from_headers(elem, attr, root)
7
- header = @@TH_CSS_QUERY_REGEXP.match(elem.css_path)
8
- if header
9
- instrument_column(elem, attr, header.captures, @@TH_CSS_QUERY_REGEXP, root)
10
- return true
11
- end
12
-
13
- single_header = @@TH_CSS_SINGLE_REGEXP.match(elem.css_path)
14
- if single_header
15
- instrument_column(elem, attr, 0, @@TH_CSS_SINGLE_REGEXP, root)
16
- return true
17
- end
18
-
19
- false
20
- end
21
-
22
- def instrument_column(elem, attr, column_number, regex, root)
23
- trimmed = elem.css_path.sub(regex, '')
24
- td_css_query = trimmed + "tr > td:nth(#{column_number})"
25
-
26
- value = elem.get_attribute(attr)
27
- root.search(td_css_query).set(attr, value)
28
- end
29
-
30
- end
@@ -1,137 +0,0 @@
1
- require 'loader_helper'
2
- require 'concordion_utility'
3
-
4
- class ConcordionInvoker
5
- include LoaderHelper
6
- include ConcordionUtility
7
-
8
- def initialize(conc)
9
- @concordion = conc
10
- end
11
-
12
- def try_to_dereference(cpr)
13
- rv = nil
14
- begin
15
- rv = @concordion.dereference(cpr.system_under_test)
16
- rescue NoMethodError => e
17
- method = method_from_no_method_error(e)
18
-
19
- rv = dereference_error_message(e)
20
- end
21
- rv
22
- end
23
-
24
- def dereference_error_message(e)
25
- rv = "["
26
- clazz = e.to_s.split(":")[1]
27
- if clazz == 'NilClass'
28
- rv += "No more rows"
29
- end
30
- rv += "]"
31
- end
32
-
33
-
34
- def invoke_sut(cpr, test_context)
35
- sut_rv = nil
36
- if cpr.needs_dereference?
37
- sut_rv = try_to_dereference(cpr)
38
- else
39
-
40
- sut_rv = try_to_invoke_sut(cpr,test_context)
41
- end
42
-
43
- sut_rv
44
- end
45
-
46
- def handle_args(cpr)
47
- arg_vars = concordion_arguments(cpr.system_under_test)
48
- arg_values = arg_vars.collect {|var|
49
- if var == '#TEXT'
50
- cpr.content
51
- else
52
- @concordion.get_variable(var)
53
- end
54
- }
55
-
56
- arg_values
57
- end
58
-
59
- def arg_values_for(cpr)
60
- arg_values = []
61
- if has_arguments?(cpr.system_under_test)
62
- arg_values = handle_args(cpr)
63
- end
64
- arg_values
65
- end
66
-
67
- def try_to_invoke_sut(cpr, test_context)
68
- sut_rv = nil
69
- begin
70
- conc_method = concordion_method_name(cpr.system_under_test)
71
- sut_rv = test_context.send(conc_method, *arg_values_for(cpr))
72
- rescue NoMethodError => e
73
- sut_rv = report_error(e)
74
- end
75
- sut_rv
76
- end
77
-
78
- def report_error(e)
79
- rv = nil
80
- if e.to_s =~ /nil:NilClass/
81
- rv = "[Parse failed for: #{cpr}, cause: (#{e})]"
82
- else
83
- method = method_from_no_method_error(e)
84
- clazz = class_from_no_method_error(e)
85
- rv = "[Missing method '#{method}' in fixture #{clazz} ]"
86
- end
87
- rv
88
- end
89
-
90
- def method_from_no_method_error(e)
91
- except_str_from(e).split("`")[1].split("'")[0]
92
- end
93
-
94
- def except_str_from(e)
95
- e.exception.to_s
96
- end
97
-
98
- def class_from_no_method_error(e)
99
- except_str_from(e).split("<")[1].split(":")[0]
100
- end
101
-
102
- def invoke_concordion(cpr, sut_rv)
103
- cmd = commands[cpr.concordion_command]
104
- if cpr.is_assert_image_command?
105
- cmd.call(sut_rv, cpr.image_location)
106
- elsif cpr.is_verify_command?
107
- cmd.call(sut_rv, cpr.num_results_expected)
108
- else
109
- cmd.call(sut_rv, cpr.content)
110
- end
111
-
112
- end
113
-
114
-
115
- def commands
116
- cmds = {}
117
- cmds["assertequals"] = Proc.new { |a, b|
118
- result = (a.to_s == b)
119
- { :result => result, :actual => a, :expected => b } }
120
- cmds["execute"] = Proc.new { |a,b|
121
- result = true
122
- result = false if a.to_s =~ /Missing method/
123
- {:result => result, :actual => a, :expected => b } }
124
- cmds["verifyrows"] = Proc.new { |a,b| { :result => a.size == b, :actual => a.size, :expected => b } }
125
- cmds["asserttrue"] = Proc.new { |a, b|
126
- result = a
127
- result = false if a.instance_of?(String)
128
- { :result => result, :actual => false, :expected => true } }
129
- cmds["assert_image"] = Proc.new { |actual_data, expected_image_url|
130
- expected_data = File.read(path_for(expected_image_url))
131
- { :result => actual_data == expected_data, :actual => "[Image data of size #{actual_data.size} omitted]", :expected => "[Expected to match #{expected_image_url}]" }
132
- }
133
- cmds
134
- end
135
-
136
-
137
- end
@@ -1,17 +0,0 @@
1
-
2
- class ConcordionLookaheadHandler
3
-
4
-
5
- def is_element_setter?(elem)
6
- !elem.get_attribute('concordion:set').nil?
7
- end
8
-
9
- def handle_lookahead(cpr, test_context, processor)
10
- cpr.tag.search("/*[@]").each {|child|
11
- if is_element_setter?(child)
12
- processor.process(child, test_context)
13
- end
14
- }
15
- end
16
-
17
- end
@@ -1,72 +0,0 @@
1
- require 'concordion_utility'
2
-
3
- class ConcordionParseResult
4
- include ConcordionUtility
5
- attr_accessor :concordion_command, :system_under_test, :content, :tag
6
- def initialize(cmd, sut, content, tag)
7
- @concordion_command = cmd
8
- @system_under_test = sut
9
- @content = content
10
- @tag = tag
11
- end
12
- def to_s
13
- "Concordion command[#{@concordion_command}], System under test method[#{@system_under_test}], Tag Content[#{@content}] Image Location[#{image_location}]"
14
- end
15
-
16
- def is_assert_image_command?
17
- "assert_image" == @concordion_command
18
- end
19
-
20
- def is_set_command?
21
- "set" == @concordion_command
22
- end
23
- def is_verify_command?
24
- "verifyrows" == @concordion_command
25
- end
26
- def is_execute_command?
27
- "execute" == @concordion_command
28
- end
29
- def is_assert_true_command?
30
- "asserttrue" == @concordion_command
31
- end
32
-
33
- def num_results_expected
34
- @tag.search("tr").size - 1
35
- end
36
-
37
- def image_location
38
- return nil if @tag.nil?
39
- @tag.get_attribute('src')
40
- end
41
-
42
- def assignment
43
- concordion_assignment(@system_under_test)
44
- end
45
-
46
- def needs_dereference?
47
- @system_under_test =~ /^#/ && @system_under_test.index("=").nil?
48
- end
49
-
50
- def verify_error(actual, expected)
51
- if actual > expected
52
- diff = actual - expected
53
- @tag.inner_html += "<tr><td>[#{diff} Surplus Row(s) Returned By Fixture]</td></tr>"
54
- end
55
- end
56
-
57
- def assertion_error(actual)
58
- if is_assert_true_command?
59
- @tag.inner_html += ": expected true but received #{actual}"
60
- else
61
- @tag.inner_html += " expected but received #{actual}"
62
- end
63
- end
64
-
65
- def attribute_error(actual, expected)
66
- if is_verify_command?
67
- verify_error(actual, expected)
68
- else
69
- assertion_error(actual)
70
- end
71
- end
72
- end