concordion 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (298) hide show
  1. data/README +10 -0
  2. data/Rakefile.rb +69 -0
  3. data/html/classes/ConcordionBinder.html +176 -0
  4. data/html/classes/ConcordionBinder.src/M000042.html +18 -0
  5. data/html/classes/ConcordionBinder.src/M000043.html +23 -0
  6. data/html/classes/ConcordionBinder.src/M000044.html +20 -0
  7. data/html/classes/ConcordionCSS.html +146 -0
  8. data/html/classes/ConcordionCSS.src/M000100.html +18 -0
  9. data/html/classes/ConcordionCSS.src/M000101.html +20 -0
  10. data/html/classes/ConcordionCSSDecorator.html +242 -0
  11. data/html/classes/ConcordionCSSDecorator.src/M000011.html +25 -0
  12. data/html/classes/ConcordionCSSDecorator.src/M000012.html +18 -0
  13. data/html/classes/ConcordionCSSDecorator.src/M000013.html +18 -0
  14. data/html/classes/ConcordionCSSDecorator.src/M000014.html +18 -0
  15. data/html/classes/ConcordionCSSDecorator.src/M000015.html +18 -0
  16. data/html/classes/ConcordionCSSDecorator.src/M000016.html +18 -0
  17. data/html/classes/ConcordionCSSDecorator.src/M000017.html +20 -0
  18. data/html/classes/ConcordionCSSDecorator.src/M000018.html +29 -0
  19. data/html/classes/ConcordionConfigMethods.html +146 -0
  20. data/html/classes/ConcordionConfigMethods.src/M000123.html +30 -0
  21. data/html/classes/ConcordionConfigMethods.src/M000124.html +26 -0
  22. data/html/classes/ConcordionConstants.html +146 -0
  23. data/html/classes/ConcordionConstants.src/M000121.html +20 -0
  24. data/html/classes/ConcordionConstants.src/M000122.html +18 -0
  25. data/html/classes/ConcordionEnvironment.html +212 -0
  26. data/html/classes/ConcordionEnvironment.src/M000022.html +18 -0
  27. data/html/classes/ConcordionEnvironment.src/M000023.html +18 -0
  28. data/html/classes/ConcordionEnvironment.src/M000024.html +18 -0
  29. data/html/classes/ConcordionEnvironment.src/M000025.html +18 -0
  30. data/html/classes/ConcordionEnvironment.src/M000026.html +19 -0
  31. data/html/classes/ConcordionEnvironment.src/M000027.html +19 -0
  32. data/html/classes/ConcordionErrorCondition.html +179 -0
  33. data/html/classes/ConcordionErrorCondition.src/M000032.html +22 -0
  34. data/html/classes/ConcordionErrorCondition.src/M000033.html +25 -0
  35. data/html/classes/ConcordionInstrumenter.html +152 -0
  36. data/html/classes/ConcordionInstrumenter.src/M000045.html +30 -0
  37. data/html/classes/ConcordionInstrumenter.src/M000046.html +22 -0
  38. data/html/classes/ConcordionInternalTestMethods.html +213 -0
  39. data/html/classes/ConcordionInternalTestMethods.src/M000094.html +25 -0
  40. data/html/classes/ConcordionInternalTestMethods.src/M000095.html +23 -0
  41. data/html/classes/ConcordionInternalTestMethods.src/M000096.html +26 -0
  42. data/html/classes/ConcordionInternalTestMethods.src/M000097.html +29 -0
  43. data/html/classes/ConcordionInternalTestMethods.src/M000098.html +22 -0
  44. data/html/classes/ConcordionInternalTestMethods.src/M000099.html +18 -0
  45. data/html/classes/ConcordionInvoker.html +327 -0
  46. data/html/classes/ConcordionInvoker.src/M000058.html +18 -0
  47. data/html/classes/ConcordionInvoker.src/M000059.html +26 -0
  48. data/html/classes/ConcordionInvoker.src/M000060.html +23 -0
  49. data/html/classes/ConcordionInvoker.src/M000061.html +26 -0
  50. data/html/classes/ConcordionInvoker.src/M000062.html +27 -0
  51. data/html/classes/ConcordionInvoker.src/M000063.html +22 -0
  52. data/html/classes/ConcordionInvoker.src/M000064.html +25 -0
  53. data/html/classes/ConcordionInvoker.src/M000065.html +26 -0
  54. data/html/classes/ConcordionInvoker.src/M000066.html +18 -0
  55. data/html/classes/ConcordionInvoker.src/M000067.html +18 -0
  56. data/html/classes/ConcordionInvoker.src/M000068.html +18 -0
  57. data/html/classes/ConcordionInvoker.src/M000069.html +26 -0
  58. data/html/classes/ConcordionInvoker.src/M000070.html +35 -0
  59. data/html/classes/ConcordionLookaheadHandler.html +152 -0
  60. data/html/classes/ConcordionLookaheadHandler.src/M000028.html +18 -0
  61. data/html/classes/ConcordionLookaheadHandler.src/M000029.html +22 -0
  62. data/html/classes/ConcordionParseResult.html +369 -0
  63. data/html/classes/ConcordionParseResult.src/M000076.html +21 -0
  64. data/html/classes/ConcordionParseResult.src/M000077.html +18 -0
  65. data/html/classes/ConcordionParseResult.src/M000078.html +18 -0
  66. data/html/classes/ConcordionParseResult.src/M000079.html +18 -0
  67. data/html/classes/ConcordionParseResult.src/M000080.html +18 -0
  68. data/html/classes/ConcordionParseResult.src/M000081.html +18 -0
  69. data/html/classes/ConcordionParseResult.src/M000082.html +18 -0
  70. data/html/classes/ConcordionParseResult.src/M000083.html +18 -0
  71. data/html/classes/ConcordionParseResult.src/M000084.html +19 -0
  72. data/html/classes/ConcordionParseResult.src/M000085.html +18 -0
  73. data/html/classes/ConcordionParseResult.src/M000086.html +18 -0
  74. data/html/classes/ConcordionParseResult.src/M000087.html +21 -0
  75. data/html/classes/ConcordionParseResult.src/M000088.html +22 -0
  76. data/html/classes/ConcordionParseResult.src/M000089.html +22 -0
  77. data/html/classes/ConcordionParser.html +214 -0
  78. data/html/classes/ConcordionParser.src/M000002.html +21 -0
  79. data/html/classes/ConcordionParser.src/M000003.html +20 -0
  80. data/html/classes/ConcordionParser.src/M000004.html +20 -0
  81. data/html/classes/ConcordionParser.src/M000005.html +26 -0
  82. data/html/classes/ConcordionProcessor.html +176 -0
  83. data/html/classes/ConcordionProcessor.src/M000019.html +19 -0
  84. data/html/classes/ConcordionProcessor.src/M000020.html +22 -0
  85. data/html/classes/ConcordionProcessor.src/M000021.html +18 -0
  86. data/html/classes/ConcordionReader.html +144 -0
  87. data/html/classes/ConcordionReader.src/M000001.html +18 -0
  88. data/html/classes/ConcordionState.html +299 -0
  89. data/html/classes/ConcordionState.src/M000052.html +18 -0
  90. data/html/classes/ConcordionState.src/M000053.html +23 -0
  91. data/html/classes/ConcordionState.src/M000054.html +18 -0
  92. data/html/classes/ConcordionState.src/M000055.html +18 -0
  93. data/html/classes/ConcordionState.src/M000056.html +25 -0
  94. data/html/classes/ConcordionState.src/M000057.html +28 -0
  95. data/html/classes/ConcordionStringUtility.html +259 -0
  96. data/html/classes/ConcordionStringUtility.src/M000102.html +18 -0
  97. data/html/classes/ConcordionStringUtility.src/M000103.html +18 -0
  98. data/html/classes/ConcordionStringUtility.src/M000104.html +18 -0
  99. data/html/classes/ConcordionStringUtility.src/M000105.html +18 -0
  100. data/html/classes/ConcordionStringUtility.src/M000106.html +18 -0
  101. data/html/classes/ConcordionStringUtility.src/M000107.html +18 -0
  102. data/html/classes/ConcordionStringUtility.src/M000108.html +43 -0
  103. data/html/classes/ConcordionStringUtility.src/M000109.html +18 -0
  104. data/html/classes/ConcordionStringUtility.src/M000110.html +18 -0
  105. data/html/classes/ConcordionStringWriter.html +165 -0
  106. data/html/classes/ConcordionStringWriter.src/M000030.html +19 -0
  107. data/html/classes/ConcordionStringWriter.src/M000031.html +18 -0
  108. data/html/classes/ConcordionTestCase.html +220 -0
  109. data/html/classes/ConcordionTestCase.src/M000006.html +19 -0
  110. data/html/classes/ConcordionTestCase.src/M000007.html +19 -0
  111. data/html/classes/ConcordionTestCase.src/M000008.html +19 -0
  112. data/html/classes/ConcordionTestCase.src/M000009.html +18 -0
  113. data/html/classes/ConcordionTestCase.src/M000010.html +18 -0
  114. data/html/classes/ConcordionTestMethods.html +151 -0
  115. data/html/classes/ConcordionTestMethods.src/M000092.html +24 -0
  116. data/html/classes/ConcordionUtility.html +229 -0
  117. data/html/classes/ConcordionUtility.src/M000114.html +18 -0
  118. data/html/classes/ConcordionUtility.src/M000115.html +34 -0
  119. data/html/classes/ConcordionUtility.src/M000116.html +22 -0
  120. data/html/classes/ConcordionUtility.src/M000117.html +18 -0
  121. data/html/classes/ConcordionUtility.src/M000118.html +22 -0
  122. data/html/classes/ConcordionUtility.src/M000119.html +18 -0
  123. data/html/classes/ConcordionUtility.src/M000120.html +25 -0
  124. data/html/classes/ConcordionVerifier.html +219 -0
  125. data/html/classes/ConcordionVerifier.src/M000071.html +20 -0
  126. data/html/classes/ConcordionVerifier.src/M000072.html +20 -0
  127. data/html/classes/ConcordionVerifier.src/M000073.html +23 -0
  128. data/html/classes/ConcordionVerifier.src/M000074.html +22 -0
  129. data/html/classes/ConcordionVerifier.src/M000075.html +28 -0
  130. data/html/classes/ConcordionWriter.html +244 -0
  131. data/html/classes/ConcordionWriter.src/M000034.html +18 -0
  132. data/html/classes/ConcordionWriter.src/M000035.html +20 -0
  133. data/html/classes/ConcordionWriter.src/M000036.html +18 -0
  134. data/html/classes/ConcordionWriter.src/M000037.html +18 -0
  135. data/html/classes/ConcordionWriter.src/M000038.html +21 -0
  136. data/html/classes/ConcordionWriter.src/M000039.html +22 -0
  137. data/html/classes/ConcordionWriter.src/M000040.html +18 -0
  138. data/html/classes/ConcordionWriter.src/M000041.html +18 -0
  139. data/html/classes/FailConditionally.html +131 -0
  140. data/html/classes/FailConditionally.src/M000090.html +22 -0
  141. data/html/classes/GoldmasterTestCase.html +208 -0
  142. data/html/classes/GoldmasterTestCase.src/M000047.html +22 -0
  143. data/html/classes/GoldmasterTestCase.src/M000048.html +18 -0
  144. data/html/classes/GoldmasterTestCase.src/M000049.html +18 -0
  145. data/html/classes/GoldmasterTestCase.src/M000050.html +18 -0
  146. data/html/classes/GoldmasterTestCase.src/M000051.html +31 -0
  147. data/html/classes/LoaderHelper.html +138 -0
  148. data/html/classes/LoaderHelper.src/M000093.html +24 -0
  149. data/html/classes/PluralToSingularUtility.html +131 -0
  150. data/html/classes/PluralToSingularUtility.src/M000091.html +18 -0
  151. data/html/classes/SnakeCaseUtility.html +161 -0
  152. data/html/classes/SnakeCaseUtility.src/M000111.html +23 -0
  153. data/html/classes/SnakeCaseUtility.src/M000112.html +20 -0
  154. data/html/classes/SnakeCaseUtility.src/M000113.html +18 -0
  155. data/html/created.rid +1 -0
  156. data/html/files/README.html +123 -0
  157. data/html/files/lib/concordion_binder_rb.html +108 -0
  158. data/html/files/lib/concordion_constants_rb.html +101 -0
  159. data/html/files/lib/concordion_css_decorator_rb.html +109 -0
  160. data/html/files/lib/concordion_css_rb.html +101 -0
  161. data/html/files/lib/concordion_environment_rb.html +101 -0
  162. data/html/files/lib/concordion_error_condition_rb.html +108 -0
  163. data/html/files/lib/concordion_instrumenter_rb.html +101 -0
  164. data/html/files/lib/concordion_invoker_rb.html +109 -0
  165. data/html/files/lib/concordion_lookahead_handler_rb.html +101 -0
  166. data/html/files/lib/concordion_parse_result_rb.html +108 -0
  167. data/html/files/lib/concordion_parser_rb.html +110 -0
  168. data/html/files/lib/concordion_processor_rb.html +108 -0
  169. data/html/files/lib/concordion_rb.html +108 -0
  170. data/html/files/lib/concordion_reader_rb.html +108 -0
  171. data/html/files/lib/concordion_state_rb.html +112 -0
  172. data/html/files/lib/concordion_string_utility_rb.html +101 -0
  173. data/html/files/lib/concordion_string_writer_rb.html +101 -0
  174. data/html/files/lib/concordion_test_case_rb.html +119 -0
  175. data/html/files/lib/concordion_test_methods_rb.html +125 -0
  176. data/html/files/lib/concordion_utility_rb.html +109 -0
  177. data/html/files/lib/concordion_verifier_rb.html +108 -0
  178. data/html/files/lib/concordion_writer_rb.html +101 -0
  179. data/html/files/lib/goldmaster_test_case_rb.html +110 -0
  180. data/html/files/lib/loader_helper_rb.html +108 -0
  181. data/html/files/lib/rcor_rb.html +108 -0
  182. data/html/fr_class_index.html +54 -0
  183. data/html/fr_file_index.html +52 -0
  184. data/html/fr_method_index.html +150 -0
  185. data/html/index.html +24 -0
  186. data/html/rdoc-style.css +208 -0
  187. data/lib/concordion.rb +2 -0
  188. data/lib/concordion_binder.rb +24 -0
  189. data/lib/concordion_constants.rb +13 -0
  190. data/lib/concordion_css.rb +179 -0
  191. data/lib/concordion_css_decorator.rb +58 -0
  192. data/lib/concordion_environment.rb +27 -0
  193. data/lib/concordion_error_condition.rb +26 -0
  194. data/lib/concordion_instrumenter.rb +30 -0
  195. data/lib/concordion_invoker.rb +137 -0
  196. data/lib/concordion_lookahead_handler.rb +17 -0
  197. data/lib/concordion_parse_result.rb +72 -0
  198. data/lib/concordion_parser.rb +47 -0
  199. data/lib/concordion_processor.rb +25 -0
  200. data/lib/concordion_reader.rb +10 -0
  201. data/lib/concordion_state.rb +78 -0
  202. data/lib/concordion_string_utility.rb +97 -0
  203. data/lib/concordion_string_writer.rb +13 -0
  204. data/lib/concordion_test_case.rb +47 -0
  205. data/lib/concordion_test_methods.rb +132 -0
  206. data/lib/concordion_utility.rb +70 -0
  207. data/lib/concordion_verifier.rb +50 -0
  208. data/lib/concordion_writer.rb +43 -0
  209. data/lib/goldmaster_test_case.rb +55 -0
  210. data/lib/loader_helper.rb +16 -0
  211. data/lib/rcor.rb +3 -0
  212. data/nbproject/private/config.properties +0 -0
  213. data/nbproject/private/private.properties +4 -0
  214. data/nbproject/private/private.xml +4 -0
  215. data/nbproject/private/rake-d.txt +21 -0
  216. data/nbproject/project.properties +11 -0
  217. data/nbproject/project.xml +16 -0
  218. data/test-lib/single_row_result.rb +9 -0
  219. data/test-lib/user.rb +8 -0
  220. data/tests/basic_assert.html +5 -0
  221. data/tests/basic_assert_test.rb +9 -0
  222. data/tests/basic_set.html +11 -0
  223. data/tests/basic_set_test.rb +8 -0
  224. data/tests/basic_text.html +14 -0
  225. data/tests/basic_text_test.rb +23 -0
  226. data/tests/concordion/concordion_css_decorator_test.rb +28 -0
  227. data/tests/concordion/concordion_environment_test.rb +44 -0
  228. data/tests/concordion/concordion_parse_result_test.rb +51 -0
  229. data/tests/concordion/concordion_reader_test.rb +15 -0
  230. data/tests/concordion/concordion_state_test.rb +38 -0
  231. data/tests/concordion/concordion_string_writer_test.rb +13 -0
  232. data/tests/concordion/concordion_utility_test.rb +135 -0
  233. data/tests/concordion/concordion_verifier_test.rb +38 -0
  234. data/tests/concordion/concordion_writer_test.rb +26 -0
  235. data/tests/concordion/goldmaster_test_case_test.rb +24 -0
  236. data/tests/concordion.css +2 -0
  237. data/tests/failing.html +9 -0
  238. data/tests/failing_test.rb +22 -0
  239. data/tests/goldmasters/failing_with_subclass.html +6 -0
  240. data/tests/goldmasters/failing_with_subclass_goldmaster.html +170 -0
  241. data/tests/goldmasters/failing_with_subclass_test.rb +24 -0
  242. data/tests/goldmasters/goldmaster_assert_true_failing.html +5 -0
  243. data/tests/goldmasters/goldmaster_assert_true_failing_goldmaster.html +169 -0
  244. data/tests/goldmasters/goldmaster_assert_true_failing_test.rb +14 -0
  245. data/tests/goldmasters/goldmaster_failing.html +45 -0
  246. data/tests/goldmasters/goldmaster_failing_goldmaster.html +209 -0
  247. data/tests/goldmasters/goldmaster_failing_test.rb +37 -0
  248. data/tests/goldmasters/goldmaster_malformed.html +7 -0
  249. data/tests/goldmasters/goldmaster_malformed_goldmaster.html +171 -0
  250. data/tests/goldmasters/goldmaster_malformed_test.rb +11 -0
  251. data/tests/goldmasters/goldmaster_passing.html +5 -0
  252. data/tests/goldmasters/goldmaster_passing_goldmaster.html +169 -0
  253. data/tests/goldmasters/goldmaster_passing_test.rb +9 -0
  254. data/tests/goldmasters/goldmaster_table.html +46 -0
  255. data/tests/goldmasters/goldmaster_table_bug.html +12 -0
  256. data/tests/goldmasters/goldmaster_table_bug_goldmaster.html +176 -0
  257. data/tests/goldmasters/goldmaster_table_bug_test.rb +24 -0
  258. data/tests/goldmasters/goldmaster_table_goldmaster.html +210 -0
  259. data/tests/goldmasters/goldmaster_table_test.rb +17 -0
  260. data/tests/image.html +5 -0
  261. data/tests/image.jpg +0 -0
  262. data/tests/image_test.rb +9 -0
  263. data/tests/link_style_css.html +5 -0
  264. data/tests/link_style_css_test.rb +16 -0
  265. data/tests/lookahead_assert_true.html +25 -0
  266. data/tests/lookahead_assert_true_test.rb +17 -0
  267. data/tests/mixed.html +5 -0
  268. data/tests/mixed_test.rb +19 -0
  269. data/tests/nested_element_lookahead.html +9 -0
  270. data/tests/nested_element_lookahead_test.rb +8 -0
  271. data/tests/numbers.html +5 -0
  272. data/tests/numbers_test.rb +11 -0
  273. data/tests/processes_elements_in_sorted_order.html +12 -0
  274. data/tests/processes_elements_in_sorted_order_test.rb +13 -0
  275. data/tests/return_result.html +7 -0
  276. data/tests/return_result_test.rb +17 -0
  277. data/tests/tables/single_row_table.html +13 -0
  278. data/tests/tables/single_row_table_test.rb +9 -0
  279. data/tests/tables/table.html +28 -0
  280. data/tests/tables/table_test.rb +9 -0
  281. data/tests/tables/test_helper.rb +9 -0
  282. data/tests/tables/verify_rows.html +46 -0
  283. data/tests/tables/verify_rows_scsr.html +27 -0
  284. data/tests/tables/verify_rows_scsr_test.rb +17 -0
  285. data/tests/tables/verify_rows_simple.html +14 -0
  286. data/tests/tables/verify_rows_simple_test.rb +17 -0
  287. data/tests/tables/verify_rows_test.rb +16 -0
  288. data/tests/user-reported/apostrophe.html +7 -0
  289. data/tests/user-reported/apostrophe_test.rb +18 -0
  290. data/tests/user-reported/ariel_example.html +13 -0
  291. data/tests/user-reported/ariel_example_test.rb +36 -0
  292. data/tests/user-reported/attr_assert.html +7 -0
  293. data/tests/user-reported/attr_assert_test.rb +13 -0
  294. data/tests/user-reported/basic_assert_true.html +6 -0
  295. data/tests/user-reported/basic_assert_true_test.rb +15 -0
  296. data/tests/user-reported/no_parens.html +15 -0
  297. data/tests/user-reported/no_parens_test.rb +20 -0
  298. metadata +403 -0
@@ -0,0 +1,38 @@
1
+ require 'test/unit'
2
+ require 'test_helper'
3
+ require 'concordion_state'
4
+
5
+ class ConcordionStateTest < Test::Unit::TestCase
6
+
7
+ def setup
8
+ @concordion = ConcordionState.new
9
+ @thingy = Thingy.new()
10
+ end
11
+
12
+ def test_text_variable
13
+ assert_equal ConcordionState.TEXT_VAR, "#TEXT"
14
+ end
15
+ def test_set_variable
16
+ @concordion.set_variable("#foo", "bar")
17
+
18
+ assert_equal "bar", @concordion.get_variable("#foo")
19
+ end
20
+
21
+ def test_dereference
22
+ @concordion.set_variable("#result", @thingy)
23
+
24
+ assert_same @thingy, @concordion.dereference("#result")
25
+ end
26
+ def test_dereference_with_property
27
+ @concordion.set_variable("#result", @thingy)
28
+
29
+ assert_equal "bleh", @concordion.dereference("#result.prop")
30
+ end
31
+
32
+ class Thingy
33
+ attr_accessor :prop
34
+ def initialize
35
+ @prop = "bleh"
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,13 @@
1
+ # To change this template, choose Tools | Templates
2
+ # and open the template in the editor.
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__),'..','lib')
5
+
6
+ require 'test/unit'
7
+ require 'concordion_string_writer'
8
+
9
+ class ConcordionStringWriterTest < Test::Unit::TestCase
10
+ def test_foo
11
+ assert ConcordionStringWriter.new.output_file_exists?("this is a lie, i don't really exist, but thats ok for string writers")
12
+ end
13
+ end
@@ -0,0 +1,135 @@
1
+ require 'test_helper'
2
+ require 'concordion_utility'
3
+
4
+ class ConcordionUtilityTest < Test::Unit::TestCase
5
+ include ConcordionUtility
6
+
7
+ def test_supported
8
+ assert supported?('p')
9
+ assert supported?("p")
10
+ assert supported?("P")
11
+ assert !supported?("R")
12
+ end
13
+
14
+ def test_snakeCase
15
+ assert_equal "bob", snake_case("bob")
16
+ assert_equal "bob", snake_case("Bob")
17
+ assert_equal "camel_case", snake_case("CamelCase")
18
+ assert_equal "camel_case_var", snake_case("camelCaseVar")
19
+ end
20
+
21
+
22
+ def test_snake_cased_test_name
23
+ assert_equal "bob.html", snake_cased_test_name("bob")
24
+ assert_equal "bob.html", snake_cased_test_name("Bob")
25
+ assert_equal "bob.html", snake_cased_test_name("BobTest")
26
+ assert_equal "bob_case.html", snake_cased_test_name("BobCaseTest")
27
+ end
28
+
29
+ def test_snake_cased_goldmaster_name
30
+ assert_equal "bob_goldmaster.html", snake_cased_goldmaster_name("bob")
31
+ assert_equal "bob_goldmaster.html", snake_cased_goldmaster_name("Bob")
32
+ assert_equal "bob_goldmaster.html", snake_cased_goldmaster_name("BobTest")
33
+ assert_equal "bob_case_goldmaster.html", snake_cased_goldmaster_name("BobCaseTest")
34
+ end
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")
47
+
48
+ assert_equal "foo", concordion_method_name("#baz = foo #asdf, #fdsa")
49
+ assert_equal "greeting=", concordion_method_name("greeting= #TEXT")
50
+ end
51
+
52
+ def test_conc_method_name
53
+ assert_equal "invoke", concordion_method_name("invoke()")
54
+ assert_equal "invoke", concordion_method_name("invoke(")
55
+ assert_equal "invoke", concordion_method_name("invoke")
56
+ assert_equal "bleh", concordion_method_name("bleh(foo,bar)")
57
+ assert_equal "bleh", concordion_method_name("bleh ( foo , bar)")
58
+ assert_equal "foo", concordion_method_name("#baz = foo ( #asdf, #fdsa)")
59
+ assert_equal "greeting=", concordion_method_name("greeting=(#TEXT)")
60
+ end
61
+
62
+ def test_conc_var_name_no_parens
63
+ assert_equal "#result", concordion_variable_name("#result.first")
64
+ end
65
+ def test_conc_var_name
66
+ assert_equal "#result", concordion_variable_name("#result.first()")
67
+ assert_equal "#res", concordion_variable_name(" #res ")
68
+
69
+ end
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
+
83
+ def test_has_args
84
+ assert has_arguments?("invoke(#foo,#bar)")
85
+ assert has_arguments?("invoke(#foo)")
86
+ assert !has_arguments?("invoke()")
87
+ end
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
96
+ def test_conc_args
97
+ assert_equal [], concordion_arguments("invoke()")
98
+ assert_equal ["#foo","#bar"], concordion_arguments("bleh(#foo,#bar)")
99
+ assert_equal ["#foo","#bar"], concordion_arguments("bleh ( #foo , #bar )")
100
+ assert_equal ["#foo","#bar"], concordion_arguments("#asdf = bleh ( #foo , #bar )")
101
+ end
102
+
103
+ def test_conc_assignment_no_parens
104
+ assert_equal "#foo", concordion_assignment(" #foo = getResult ")
105
+ end
106
+
107
+ def test_conc_assignment
108
+ assert_equal "#foo", concordion_assignment(" #foo = getResult() ")
109
+ assert_equal "#for", concordion_assignment("#for=")
110
+ end
111
+ def test_has_assignment
112
+ assert has_assignment?("=")
113
+ assert !has_assignment?("")
114
+ end
115
+
116
+ def test_has_property_ref
117
+ assert has_property_reference?("#res.foo")
118
+ assert !has_property_reference?("#res")
119
+
120
+ end
121
+
122
+ def test_property_ref
123
+ assert_equal "#foo", concordion_property_reference("#foo")
124
+ assert_equal "bar", concordion_property_reference(" #foo.bar ")
125
+ assert_equal "bar.baz", concordion_property_reference("#for.bar.baz")
126
+
127
+ end
128
+
129
+ def test_singular
130
+ assert_equal "bar", singular("bars")
131
+ assert_equal "foo", singular("foo")
132
+ end
133
+
134
+
135
+ end
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+ require 'concordion'
3
+ require 'concordion_verifier'
4
+
5
+ class ConcordionVerifierTest < Test::Unit::TestCase
6
+
7
+ def setup
8
+ @concordion = ConcordionState.new
9
+ @verifier = ConcordionVerifier.new(@concordion)
10
+ end
11
+
12
+
13
+
14
+ def test_update_does_not_blow_up_if_verification_variable_unset
15
+ @verifier.verification_variable = nil
16
+ @verifier.update_verifier(1)
17
+ end
18
+
19
+ def test_update_verification
20
+ assert @concordion.get_variable("#user").nil?
21
+ @concordion.set_variable("#users", ["A", "B", "C"])
22
+ @verifier.verification_variable = "#users"
23
+ @verifier.update_verifier(2) # will be one larger because of the header row
24
+
25
+ assert_equal "B", @concordion.get_variable("#user")
26
+ end
27
+
28
+
29
+ def test_update_verification_automatically_sets_to_zero
30
+ assert @concordion.get_variable("#user").nil?
31
+ @concordion.set_variable("#users", ["A", "B", "C"])
32
+ @verifier.verification_variable = "#users"
33
+
34
+ assert_equal "A", @concordion.get_variable("#user")
35
+ end
36
+
37
+
38
+ end
@@ -0,0 +1,26 @@
1
+ require 'test_helper'
2
+ require 'rubygems'
3
+ require 'mocha'
4
+ require 'concordion_writer'
5
+ class ConcordionWriterTest < Test::Unit::TestCase
6
+ def test_output_file_name
7
+
8
+ assert_equal "./bleh_test_output.html",
9
+ ConcordionWriter.new.output_filename_for("bleh.html")
10
+ assert_equal "./bleh_test_output.html",
11
+ ConcordionWriter.new(nil).output_filename_for("bleh.html")
12
+ assert_equal "foo/bleh_test_output.html",
13
+ ConcordionWriter.new("foo").output_filename_for("bleh.html")
14
+
15
+
16
+ end
17
+
18
+ def test_output_file_exists
19
+ File.expects(:exists?).with("foo/output.css").returns(true)
20
+ File.expects(:exists?).with("foo/missing").returns(false)
21
+
22
+ assert ConcordionWriter.new("foo").output_file_exists?("output.css")
23
+ assert !ConcordionWriter.new("foo").output_file_exists?("missing")
24
+ end
25
+
26
+ end
@@ -0,0 +1,24 @@
1
+ # To change this template, choose Tools | Templates
2
+ # and open the template in the editor.
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__),'..','lib')
5
+
6
+ require 'test/unit'
7
+ require 'goldmaster_test_case'
8
+ require 'mocha'
9
+
10
+ class GoldmasterTestCaseTest < Test::Unit::TestCase
11
+ include FailConditionally
12
+
13
+ def write_goldmaster!
14
+ true
15
+ end
16
+
17
+ def test_blows_up_if_write_goldmaster_is_left_enabled
18
+ assert_raise RuntimeError do
19
+ writer = mock("writer")
20
+ writer.expects(:write).with("foo", "bar.html")
21
+ fail_if_write_still_enabled(self.class, writer, "foo", "bar.html")
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,2 @@
1
+ .concordion_failure { background-color: red }
2
+ .concordion_success { background-color: green }
@@ -0,0 +1,9 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
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>
8
+ </body>
9
+ </html>
@@ -0,0 +1,22 @@
1
+ require 'test_helper'
2
+ require 'concordion_test_case'
3
+
4
+ class FailingTest < ConcordionTestCase
5
+
6
+ def expected_failure_count
7
+ 3
8
+ end
9
+
10
+ def wrong_value4
11
+ "wrong"
12
+ end
13
+
14
+ def wrong_value2
15
+ "wrong"
16
+ end
17
+ def wrong_value
18
+ "wrong"
19
+ end
20
+
21
+ end
22
+
@@ -0,0 +1,6 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
3
+ <p concordion:assertEquals="getGreeting">Hello World!</p>
4
+ <p concordion:assertTrue="no_such_method_in_fixture">Thats ok, look how nice the error is.</p>
5
+ </body>
6
+ </html>
@@ -0,0 +1,170 @@
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 concordion:assertequals="getGreeting" class="concordion_failure">Hello World! expected but received Hello World?</p>
168
+ <p concordion:asserttrue="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 FailingWithSubclassTest ]</p>
169
+ </body>
170
+ </html>
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+ require 'concordion_test_methods'
3
+
4
+
5
+ class ArbitraryBaseTestCase < Test::Unit::TestCase
6
+ def test_something_to_quiet_runit
7
+ assert_equal 1,1
8
+ end
9
+ end
10
+
11
+ class FailingWithSubclassTest < ArbitraryBaseTestCase
12
+ include ConcordionTestMethods
13
+
14
+ def expected_failure_count
15
+ 2
16
+ end
17
+
18
+ def getGreeting
19
+ "Hello World?"
20
+ end
21
+
22
+
23
+ end
24
+
@@ -0,0 +1,5 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
3
+ <p concordion:assertTrue="getFalse()">Uh Oh</p>
4
+ </body>
5
+ </html>
@@ -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>