rcor 0.8.1 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/Rakefile.rb +1 -1
  2. data/lib/concordion.rb +1 -8
  3. data/lib/concordion_constants.rb +1 -1
  4. data/lib/concordion_css.rb +8 -1
  5. data/lib/concordion_css_decorator.rb +21 -4
  6. data/lib/concordion_error_condition.rb +26 -0
  7. data/lib/concordion_invoker.rb +103 -9
  8. data/lib/concordion_parse_result.rb +19 -1
  9. data/lib/concordion_parser.rb +1 -1
  10. data/lib/concordion_processor.rb +3 -2
  11. data/lib/concordion_string_utility.rb +36 -2
  12. data/lib/concordion_test_case.rb +12 -62
  13. data/lib/concordion_test_methods.rb +127 -0
  14. data/lib/concordion_utility.rb +15 -3
  15. data/lib/goldmaster_test_case.rb +22 -5
  16. data/lib/loader_helper.rb +16 -0
  17. data/nbproject/private/private.xml +0 -6
  18. data/nbproject/private/rake-d.txt +13 -0
  19. data/tests/apostrophe.html +7 -0
  20. data/tests/apostrophe_test.rb +18 -0
  21. data/tests/ariel_example.html +13 -0
  22. data/tests/ariel_example_test.rb +36 -0
  23. data/tests/attr_assert.html +2 -0
  24. data/tests/basic_assert_true_test.rb +5 -1
  25. data/tests/basic_set.html +3 -0
  26. data/tests/basic_text.html +8 -0
  27. data/tests/basic_text_test.rb +11 -0
  28. data/tests/concordion_parse_result_test.rb +16 -1
  29. data/tests/concordion_test.rb +0 -14
  30. data/tests/concordion_utility_test.rb +44 -0
  31. data/tests/failing.html +4 -0
  32. data/tests/failing_test.rb +10 -2
  33. data/tests/goldmaster_assert_true_failing.html +5 -0
  34. data/tests/goldmaster_assert_true_failing_goldmaster.html +169 -0
  35. data/tests/goldmaster_assert_true_failing_test.rb +14 -0
  36. data/tests/goldmaster_failing.html +40 -0
  37. data/tests/goldmaster_failing_goldmaster.html +48 -1
  38. data/tests/goldmaster_failing_test.rb +28 -2
  39. data/tests/goldmaster_malformed.html +7 -0
  40. data/tests/goldmaster_malformed_goldmaster.html +171 -0
  41. data/tests/goldmaster_malformed_test.rb +11 -0
  42. data/tests/goldmaster_passing_goldmaster.html +8 -1
  43. data/tests/goldmaster_table_bug.html +12 -0
  44. data/tests/goldmaster_table_bug_goldmaster.html +176 -0
  45. data/tests/goldmaster_table_bug_test.rb +24 -0
  46. data/tests/goldmaster_table_goldmaster.html +8 -1
  47. data/tests/image.html +5 -0
  48. data/tests/image.jpg +0 -0
  49. data/tests/image_test.rb +9 -0
  50. data/tests/mixed.html +5 -0
  51. data/tests/mixed_test.rb +19 -0
  52. data/tests/no_parens.html +15 -0
  53. data/tests/no_parens_test.rb +20 -0
  54. data/tests/numbers.html +5 -0
  55. data/tests/numbers_test.rb +11 -0
  56. data/tests/verify_rows_scsr_test.rb +2 -0
  57. data/tests/verify_rows_simple.html +14 -0
  58. data/tests/verify_rows_simple_test.rb +17 -0
  59. metadata +31 -4
  60. data/lib/concordion_invocation_string_builder.rb +0 -24
@@ -0,0 +1,5 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
3
+ <img src="image.jpg" concordion:assert_image="image_data()" />
4
+ </body>
5
+ </html>
Binary file
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+ require 'concordion_test_case'
3
+ require 'loader_helper'
4
+ class ImageTest < ConcordionTestCase
5
+ include LoaderHelper
6
+ def image_data
7
+ File.read(path_for("image.jpg"))
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
3
+ <p concordion:assertEquals="easy">as pie</p>
4
+ </body>
5
+ </html>
@@ -0,0 +1,19 @@
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
+
8
+ require 'concordion_test_methods'
9
+
10
+ class MixedTest < Test::Unit::TestCase
11
+ include ConcordionTestMethods
12
+
13
+ def easy
14
+ "as pie"
15
+ end
16
+ def test_foo
17
+ assert_equal "foo", "foo"
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
3
+ <p concordion:assertEquals="no_args">foo</p>
4
+ <p concordion:assertEquals="return_arg #TEXT">foo</p>
5
+ <p concordion:set="#bar">bar</p>
6
+ <p concordion:set="#baz">baz</p>
7
+ <p concordion:assertEquals="concat #bar, #baz">bar:baz</p>
8
+ <p concordion:execute="#result = concat #TEXT, #TEXT">AA</p>
9
+ <p concordion:assertEquals="#result">AA:AA</p>
10
+ <p concordion:execute="#result = concat #baz, #TEXT">zab</p>
11
+ <p concordion:assertEquals="#result">baz:zab</p>
12
+ <p concordion:execute="#result = concat #TEXT, #bar">fed</p>
13
+ <p concordion:assertEquals="#result">fed:bar</p>
14
+ </body>
15
+ </html>
@@ -0,0 +1,20 @@
1
+ require 'test_helper'
2
+ require 'concordion_test_case'
3
+
4
+ class NoParensTest < ConcordionTestCase
5
+
6
+ def no_args
7
+ "foo"
8
+ end
9
+
10
+ def return_arg(arg)
11
+ arg
12
+ end
13
+
14
+ def concat(a,b)
15
+ raise "second arg nil" if b.nil?
16
+ raise "first arg nil" if a.nil?
17
+
18
+ "#{a}:#{b}"
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
3
+ <p concordion:assertEquals="seven()">7</p>
4
+ </body>
5
+ </html>
@@ -0,0 +1,11 @@
1
+ require 'test_helper'
2
+ require 'concordion_test_case'
3
+
4
+ class NumbersTest < ConcordionTestCase
5
+
6
+ def seven
7
+ 7
8
+ end
9
+
10
+
11
+ end
@@ -1,4 +1,6 @@
1
1
 
2
+ require 'concordion_test_case'
3
+ require 'user'
2
4
  class VerifyRowsScsrTest < ConcordionTestCase
3
5
  def setup
4
6
  @users = []
@@ -0,0 +1,14 @@
1
+ <html xmlns:concordion="http://www.concordion.org/2007/concordion">
2
+ <body>
3
+
4
+ <table concordion:verifyRows="#users = getSearchResultsFor(#searchString)">
5
+ <tr>
6
+ <th concordion:assertEquals="#user.foo">and their Other field</th>
7
+ </tr>
8
+ <tr>
9
+ <td>bar</td>
10
+ </tr>
11
+ </table>
12
+ </body>
13
+ </html>
14
+
@@ -0,0 +1,17 @@
1
+ require 'test_helper'
2
+ require 'concordion_test_case'
3
+
4
+ class Thingit
5
+ attr_reader :foo
6
+ def initialize(foo)
7
+ @foo = foo
8
+ end
9
+ end
10
+
11
+ class VerifyRowsSimpleTest < ConcordionTestCase
12
+ def getSearchResultsFor(query)
13
+ users = []
14
+ users << Thingit.new("bar")
15
+ users
16
+ end
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Goodspeed
@@ -9,7 +9,7 @@ autorequire: rake
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-28 00:00:00 -04:00
12
+ date: 2009-02-09 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -36,11 +36,19 @@ files:
36
36
  - test-lib/user.rb
37
37
  - Rakefile.rb
38
38
  - tests
39
+ - tests/goldmaster_malformed.html
39
40
  - tests/concordion_test.rb
41
+ - tests/no_parens_test.rb
40
42
  - tests/concordion_utility_test.rb
41
43
  - tests/basic_assert_true.html
42
44
  - tests/goldmaster_passing_test.rb
43
45
  - tests/goldmaster_passing.html
46
+ - tests/goldmaster_malformed_test.rb
47
+ - tests/goldmaster_table_bug.html
48
+ - tests/goldmaster_assert_true_failing_test.rb
49
+ - tests/goldmaster_table_bug_test.rb
50
+ - tests/apostrophe_test.rb
51
+ - tests/apostrophe.html
44
52
  - tests/concordion_writer_test.rb
45
53
  - tests/attr_assert.html
46
54
  - tests/goldmaster_failing_test.rb
@@ -48,51 +56,69 @@ files:
48
56
  - tests/verify_rows.html
49
57
  - tests/basic_assert.html
50
58
  - tests/goldmaster_table_test.rb
59
+ - tests/verify_rows_simple.html
60
+ - tests/ariel_example_test.rb
51
61
  - tests/goldmaster_failing.html
52
62
  - tests/lookahead_assert_true_test.rb
63
+ - tests/mixed_test.rb
53
64
  - tests/failing.html
65
+ - tests/numbers_test.rb
66
+ - tests/mixed.html
54
67
  - tests/table.html
55
68
  - tests/basic_set_test.rb
56
69
  - tests/concordion_verifier_test.rb
57
70
  - tests/lookahead_assert_true.html
71
+ - tests/no_parens.html
58
72
  - tests/basic_text.html
59
73
  - tests/test_helper.rb
60
74
  - tests/processes_elements_in_sorted_order_test.rb
61
75
  - tests/verify_rows_scsr.html
76
+ - tests/ariel_example.html
62
77
  - tests/return_result_test.rb
63
78
  - tests/nested_element_lookahead.html
64
79
  - tests/single_row_table.html
65
80
  - tests/nested_element_lookahead_test.rb
81
+ - tests/image_test.rb
66
82
  - tests/basic_assert_true_test.rb
67
83
  - tests/goldmaster_failing_goldmaster.html
84
+ - tests/goldmaster_assert_true_failing.html
68
85
  - tests/basic_set.html
86
+ - tests/verify_rows_simple_test.rb
69
87
  - tests/goldmaster_passing_goldmaster.html
70
88
  - tests/failing_test.rb
71
89
  - tests/return_result.html
72
90
  - tests/verify_rows_scsr_test.rb
73
91
  - tests/processes_elements_in_sorted_order.html
92
+ - tests/goldmaster_table_bug_goldmaster.html
93
+ - tests/image.jpg
74
94
  - tests/basic_text_test.rb
95
+ - tests/numbers.html
75
96
  - tests/goldmaster_table_goldmaster.html
76
97
  - tests/concordion_parse_result_test.rb
77
98
  - tests/verify_rows_test.rb
78
99
  - tests/concordion_css_decorator_test.rb
100
+ - tests/goldmaster_assert_true_failing_goldmaster.html
101
+ - tests/image.html
79
102
  - tests/goldmaster_table.html
80
103
  - tests/single_row_table_test.rb
104
+ - tests/goldmaster_malformed_goldmaster.html
81
105
  - tests/table_test.rb
82
106
  - tests/basic_assert_test.rb
83
107
  - tests/concordion_environment_test.rb
84
108
  - tests/attr_assert_test.rb
85
109
  - lib
86
110
  - lib/concordion.rb
111
+ - lib/concordion_error_condition.rb
87
112
  - lib/rcor.rb
88
113
  - lib/goldmaster_test_case.rb
89
- - lib/concordion_invocation_string_builder.rb
90
114
  - lib/concordion_parse_result.rb
91
115
  - lib/concordion_processor.rb
92
116
  - lib/concordion_string_writer.rb
93
117
  - lib/concordion_instrumenter.rb
118
+ - lib/concordion_test_methods.rb
94
119
  - lib/concordion_lookahead_handler.rb
95
120
  - lib/concordion_invoker.rb
121
+ - lib/loader_helper.rb
96
122
  - lib/concordion_environment.rb
97
123
  - lib/concordion_verifier.rb
98
124
  - lib/concordion_parser.rb
@@ -112,6 +138,7 @@ files:
112
138
  - nbproject/private/config.properties
113
139
  - nbproject/private/private.properties
114
140
  - nbproject/private/private.xml
141
+ - nbproject/private/rake-d.txt
115
142
  has_rdoc: false
116
143
  homepage:
117
144
  post_install_message:
@@ -134,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
161
  requirements:
135
162
  - hpricot HTML parser
136
163
  rubyforge_project:
137
- rubygems_version: 1.2.0
164
+ rubygems_version: 1.3.1
138
165
  signing_key:
139
166
  specification_version: 2
140
167
  summary: Ruby based concordion
@@ -1,24 +0,0 @@
1
- require 'concordion_utility'
2
-
3
-
4
- class ConcordionInvocationStringBuilder
5
- include ConcordionUtility
6
- def initialize(concordion)
7
- @concordion = concordion
8
- end
9
-
10
- def build_invocation_string(conc_call, content)
11
- base = "self.send('#{concordion_method_name(conc_call)}'"
12
- if has_arguments?(conc_call)
13
- arg_vars = concordion_arguments(conc_call)
14
- arg_values = arg_vars.collect {|var| "'#{@concordion.get_variable(var)}'" }
15
-
16
- args = arg_values.join(", ")
17
- base += ", " + args
18
- end
19
-
20
- rv = base + ")"
21
-
22
- rv.gsub(Concordion.TEXT_VAR, content)
23
- end
24
- end