honkster-webrat 0.4.4.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. data/.document +4 -0
  2. data/.gitignore +16 -0
  3. data/History.txt +56 -1
  4. data/Rakefile +79 -91
  5. data/VERSION +1 -0
  6. data/lib/webrat/{mechanize.rb → adapters/mechanize.rb} +5 -1
  7. data/lib/webrat/adapters/merb.rb +11 -0
  8. data/lib/webrat/adapters/rack.rb +25 -0
  9. data/lib/webrat/{rails.rb → adapters/rails.rb} +6 -30
  10. data/lib/webrat/adapters/sinatra.rb +9 -0
  11. data/lib/webrat/core/configuration.rb +6 -16
  12. data/lib/webrat/core/elements/area.rb +2 -2
  13. data/lib/webrat/core/elements/element.rb +3 -3
  14. data/lib/webrat/core/elements/field.rb +107 -31
  15. data/lib/webrat/core/elements/form.rb +4 -4
  16. data/lib/webrat/core/elements/label.rb +4 -4
  17. data/lib/webrat/core/elements/link.rb +5 -5
  18. data/lib/webrat/core/elements/select_option.rb +15 -2
  19. data/lib/webrat/core/locators/area_locator.rb +3 -3
  20. data/lib/webrat/core/locators/button_locator.rb +6 -6
  21. data/lib/webrat/core/locators/field_by_id_locator.rb +3 -3
  22. data/lib/webrat/core/locators/field_labeled_locator.rb +2 -2
  23. data/lib/webrat/core/locators/field_named_locator.rb +3 -3
  24. data/lib/webrat/core/locators/form_locator.rb +1 -1
  25. data/lib/webrat/core/locators/label_locator.rb +2 -2
  26. data/lib/webrat/core/locators/link_locator.rb +7 -7
  27. data/lib/webrat/core/locators/select_option_locator.rb +5 -5
  28. data/lib/webrat/core/locators.rb +1 -1
  29. data/lib/webrat/core/logging.rb +4 -5
  30. data/lib/webrat/core/matchers/have_content.rb +2 -7
  31. data/lib/webrat/core/matchers/have_xpath.rb +3 -28
  32. data/lib/webrat/core/methods.rb +5 -4
  33. data/lib/webrat/core/mime.rb +11 -22
  34. data/lib/webrat/core/scope.rb +17 -2
  35. data/lib/webrat/core/session.rb +28 -12
  36. data/lib/webrat/core/xml.rb +41 -84
  37. data/lib/webrat/core.rb +0 -1
  38. data/lib/webrat/integrations/merb.rb +10 -0
  39. data/lib/webrat/integrations/rails.rb +25 -0
  40. data/lib/webrat/integrations/rspec-rails.rb +10 -0
  41. data/lib/webrat/integrations/selenium.rb +11 -0
  42. data/lib/webrat/rspec-rails.rb +2 -10
  43. data/lib/webrat/selenium/application_servers/external.rb +1 -1
  44. data/lib/webrat/selenium/application_servers.rb +1 -1
  45. data/lib/webrat/selenium/location_strategy_javascript/label.js +31 -13
  46. data/lib/webrat/selenium/location_strategy_javascript/webrat.js +1 -0
  47. data/lib/webrat/selenium/location_strategy_javascript/webratlink.js +24 -4
  48. data/lib/webrat/selenium/selenium_rc_server.rb +4 -2
  49. data/lib/webrat/selenium/selenium_session.rb +21 -2
  50. data/lib/webrat/selenium/silence_stream.rb +1 -1
  51. data/lib/webrat/selenium.rb +0 -11
  52. data/lib/webrat.rb +10 -19
  53. data/spec/fakes/test_adapter.rb +37 -0
  54. data/spec/integration/mechanize/Rakefile +7 -0
  55. data/spec/integration/mechanize/config.ru +2 -0
  56. data/spec/integration/mechanize/sample_app.rb +20 -0
  57. data/spec/integration/mechanize/spec/mechanize_spec.rb +22 -0
  58. data/spec/integration/mechanize/spec/spec_helper.rb +27 -0
  59. data/spec/integration/merb/.gitignore +21 -0
  60. data/spec/integration/merb/Rakefile +35 -0
  61. data/spec/integration/merb/app/controllers/application.rb +2 -0
  62. data/spec/integration/merb/app/controllers/exceptions.rb +13 -0
  63. data/spec/integration/merb/app/controllers/testing.rb +27 -0
  64. data/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +63 -0
  65. data/spec/integration/merb/app/views/exceptions/not_found.html.erb +47 -0
  66. data/spec/integration/merb/app/views/layout/application.html.erb +12 -0
  67. data/spec/integration/merb/app/views/testing/show_form.html.erb +27 -0
  68. data/spec/integration/merb/app/views/testing/upload.html.erb +9 -0
  69. data/spec/integration/merb/config/environments/development.rb +15 -0
  70. data/spec/integration/merb/config/environments/rake.rb +11 -0
  71. data/spec/integration/merb/config/environments/test.rb +14 -0
  72. data/spec/integration/merb/config/init.rb +25 -0
  73. data/spec/integration/merb/config/rack.rb +11 -0
  74. data/spec/integration/merb/config/router.rb +34 -0
  75. data/spec/integration/merb/spec/spec.opts +1 -0
  76. data/spec/integration/merb/spec/spec_helper.rb +26 -0
  77. data/spec/integration/merb/spec/webrat_spec.rb +39 -0
  78. data/spec/integration/merb/tasks/merb.thor/app_script.rb +31 -0
  79. data/spec/integration/merb/tasks/merb.thor/common.rb +64 -0
  80. data/spec/integration/merb/tasks/merb.thor/gem_ext.rb +124 -0
  81. data/spec/integration/merb/tasks/merb.thor/main.thor +150 -0
  82. data/spec/integration/merb/tasks/merb.thor/ops.rb +93 -0
  83. data/spec/integration/merb/tasks/merb.thor/utils.rb +40 -0
  84. data/spec/integration/rack/Rakefile +5 -0
  85. data/spec/integration/rack/app.rb +89 -0
  86. data/spec/integration/rack/test/helper.rb +21 -0
  87. data/spec/integration/rack/test/webrat_rack_test.rb +73 -0
  88. data/spec/integration/rails/.gitignore +3 -0
  89. data/spec/integration/rails/Rakefile +30 -0
  90. data/spec/integration/rails/app/controllers/application.rb +15 -0
  91. data/spec/integration/rails/app/controllers/buttons_controller.rb +7 -0
  92. data/spec/integration/rails/app/controllers/fields_controller.rb +4 -0
  93. data/spec/integration/rails/app/controllers/links_controller.rb +7 -0
  94. data/spec/integration/rails/app/controllers/webrat_controller.rb +46 -0
  95. data/spec/integration/rails/app/helpers/buttons_helper.rb +2 -0
  96. data/spec/integration/rails/app/helpers/fields_helper.rb +2 -0
  97. data/spec/integration/rails/app/helpers/links_helper.rb +2 -0
  98. data/spec/integration/rails/app/views/buttons/show.html.erb +11 -0
  99. data/spec/integration/rails/app/views/fields/show.html.erb +9 -0
  100. data/spec/integration/rails/app/views/links/show.html.erb +5 -0
  101. data/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +4 -0
  102. data/spec/integration/rails/app/views/webrat/buttons.html.erb +11 -0
  103. data/spec/integration/rails/app/views/webrat/form.html.erb +28 -0
  104. data/spec/integration/rails/app/views/webrat/within.html.erb +3 -0
  105. data/spec/integration/rails/config/boot.rb +109 -0
  106. data/spec/integration/rails/config/environment.rb +12 -0
  107. data/spec/integration/rails/config/environments/development.rb +17 -0
  108. data/spec/integration/rails/config/environments/selenium.rb +22 -0
  109. data/spec/integration/rails/config/environments/test.rb +22 -0
  110. data/spec/integration/rails/config/initializers/inflections.rb +10 -0
  111. data/spec/integration/rails/config/initializers/mime_types.rb +5 -0
  112. data/spec/integration/rails/config/initializers/new_rails_defaults.rb +17 -0
  113. data/spec/integration/rails/config/locales/en.yml +5 -0
  114. data/spec/integration/rails/config/routes.rb +19 -0
  115. data/spec/integration/rails/public/404.html +30 -0
  116. data/spec/integration/rails/public/422.html +30 -0
  117. data/spec/integration/rails/public/500.html +33 -0
  118. data/spec/integration/rails/script/about +4 -0
  119. data/spec/integration/rails/script/console +3 -0
  120. data/spec/integration/rails/script/dbconsole +3 -0
  121. data/spec/integration/rails/script/destroy +3 -0
  122. data/spec/integration/rails/script/generate +3 -0
  123. data/spec/integration/rails/script/performance/benchmarker +3 -0
  124. data/spec/integration/rails/script/performance/profiler +3 -0
  125. data/spec/integration/rails/script/performance/request +3 -0
  126. data/spec/integration/rails/script/plugin +3 -0
  127. data/spec/integration/rails/script/process/inspector +3 -0
  128. data/spec/integration/rails/script/process/reaper +3 -0
  129. data/spec/integration/rails/script/process/spawner +3 -0
  130. data/spec/integration/rails/script/runner +3 -0
  131. data/spec/integration/rails/script/server +3 -0
  132. data/spec/integration/rails/test/integration/button_click_test.rb +80 -0
  133. data/spec/integration/rails/test/integration/fill_in_test.rb +24 -0
  134. data/spec/integration/rails/test/integration/link_click_test.rb +27 -0
  135. data/spec/integration/rails/test/integration/webrat_test.rb +122 -0
  136. data/spec/integration/rails/test/test_helper.rb +26 -0
  137. data/spec/integration/sinatra/Rakefile +5 -0
  138. data/spec/integration/sinatra/classic_app.rb +64 -0
  139. data/spec/integration/sinatra/modular_app.rb +16 -0
  140. data/spec/integration/sinatra/test/classic_app_test.rb +37 -0
  141. data/spec/integration/sinatra/test/modular_app_test.rb +18 -0
  142. data/spec/integration/sinatra/test/test_helper.rb +17 -0
  143. data/spec/private/core/configuration_spec.rb +87 -0
  144. data/spec/private/core/field_spec.rb +85 -0
  145. data/spec/private/core/link_spec.rb +24 -0
  146. data/spec/private/core/session_spec.rb +200 -0
  147. data/spec/private/mechanize/mechanize_adapter_spec.rb +73 -0
  148. data/spec/private/nokogiri_spec.rb +77 -0
  149. data/spec/private/rails/attaches_file_spec.rb +81 -0
  150. data/spec/private/rails/rails_adapter_spec.rb +86 -0
  151. data/spec/private/selenium/application_servers/rails_spec.rb +26 -0
  152. data/spec/public/basic_auth_spec.rb +24 -0
  153. data/spec/public/check_spec.rb +191 -0
  154. data/spec/public/choose_spec.rb +118 -0
  155. data/spec/public/click_area_spec.rb +106 -0
  156. data/spec/public/click_button_spec.rb +494 -0
  157. data/spec/public/click_link_spec.rb +511 -0
  158. data/spec/public/fill_in_spec.rb +224 -0
  159. data/spec/public/locators/field_by_xpath_spec.rb +19 -0
  160. data/spec/public/locators/field_labeled_spec.rb +172 -0
  161. data/spec/public/locators/field_with_id_spec.rb +16 -0
  162. data/spec/public/matchers/contain_spec.rb +114 -0
  163. data/spec/public/matchers/have_selector_spec.rb +146 -0
  164. data/spec/public/matchers/have_tag_spec.rb +39 -0
  165. data/spec/public/matchers/have_xpath_spec.rb +136 -0
  166. data/spec/public/reload_spec.rb +10 -0
  167. data/spec/public/save_and_open_spec.rb +70 -0
  168. data/spec/public/select_date_spec.rb +112 -0
  169. data/spec/public/select_datetime_spec.rb +137 -0
  170. data/spec/public/select_spec.rb +455 -0
  171. data/spec/public/select_time_spec.rb +100 -0
  172. data/spec/public/selenium/application_server_factory_spec.rb +49 -0
  173. data/spec/public/selenium/application_servers/external_spec.rb +12 -0
  174. data/spec/public/selenium/selenium_session_spec.rb +37 -0
  175. data/spec/public/set_hidden_field_spec.rb +5 -0
  176. data/spec/public/submit_form_spec.rb +5 -0
  177. data/spec/public/visit_spec.rb +58 -0
  178. data/spec/public/within_spec.rb +177 -0
  179. data/spec/rcov.opts +1 -0
  180. data/spec/spec.opts +2 -0
  181. data/spec/spec_helper.rb +54 -0
  182. data/vendor/selenium-server.jar +0 -0
  183. data/webrat.gemspec +360 -0
  184. metadata +292 -27
  185. data/lib/webrat/core/xml/hpricot.rb +0 -19
  186. data/lib/webrat/core/xml/nokogiri.rb +0 -76
  187. data/lib/webrat/core/xml/rexml.rb +0 -24
  188. data/lib/webrat/merb_multipart_support.rb +0 -27
  189. data/lib/webrat/merb_session.rb +0 -80
  190. data/lib/webrat/rack.rb +0 -24
  191. data/lib/webrat/rack_test.rb +0 -32
  192. data/lib/webrat/sinatra.rb +0 -44
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honkster-webrat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp
@@ -22,21 +22,78 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.2.0
24
24
  version:
25
- description: Webrat. Ruby Acceptance Testing for Web applications
25
+ - !ruby/object:Gem::Dependency
26
+ name: rack
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "1.0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rails
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "2.3"
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: merb-core
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "1.0"
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: launchy
57
+ type: :development
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ description: |-
66
+ Webrat lets you quickly write expressive and robust acceptance tests
67
+ for a Ruby web application. It supports simulating a browser inside
68
+ a Ruby process to avoid the performance hit and browser dependency of
69
+ Selenium or Watir, but the same API can also be used to drive real
70
+ Selenium tests when necessary (eg. for testing AJAX interactions).
71
+ Most Ruby web frameworks and testing frameworks are supported.
26
72
  email: bryan@brynary.com
27
73
  executables: []
28
74
 
29
75
  extensions: []
30
76
 
31
77
  extra_rdoc_files:
32
- - README.rdoc
78
+ - History.txt
33
79
  - MIT-LICENSE.txt
80
+ - README.rdoc
34
81
  files:
82
+ - .document
83
+ - .gitignore
35
84
  - History.txt
36
- - install.rb
37
85
  - MIT-LICENSE.txt
38
86
  - README.rdoc
39
87
  - Rakefile
88
+ - VERSION
89
+ - install.rb
90
+ - lib/webrat.rb
91
+ - lib/webrat/adapters/mechanize.rb
92
+ - lib/webrat/adapters/merb.rb
93
+ - lib/webrat/adapters/rack.rb
94
+ - lib/webrat/adapters/rails.rb
95
+ - lib/webrat/adapters/sinatra.rb
96
+ - lib/webrat/core.rb
40
97
  - lib/webrat/core/configuration.rb
41
98
  - lib/webrat/core/elements/area.rb
42
99
  - lib/webrat/core/elements/element.rb
@@ -45,6 +102,7 @@ files:
45
102
  - lib/webrat/core/elements/label.rb
46
103
  - lib/webrat/core/elements/link.rb
47
104
  - lib/webrat/core/elements/select_option.rb
105
+ - lib/webrat/core/locators.rb
48
106
  - lib/webrat/core/locators/area_locator.rb
49
107
  - lib/webrat/core/locators/button_locator.rb
50
108
  - lib/webrat/core/locators/field_by_id_locator.rb
@@ -56,70 +114,191 @@ files:
56
114
  - lib/webrat/core/locators/link_locator.rb
57
115
  - lib/webrat/core/locators/locator.rb
58
116
  - lib/webrat/core/locators/select_option_locator.rb
59
- - lib/webrat/core/locators.rb
60
117
  - lib/webrat/core/logging.rb
118
+ - lib/webrat/core/matchers.rb
61
119
  - lib/webrat/core/matchers/have_content.rb
62
120
  - lib/webrat/core/matchers/have_selector.rb
63
121
  - lib/webrat/core/matchers/have_tag.rb
64
122
  - lib/webrat/core/matchers/have_xpath.rb
65
- - lib/webrat/core/matchers.rb
66
123
  - lib/webrat/core/methods.rb
67
124
  - lib/webrat/core/mime.rb
68
125
  - lib/webrat/core/save_and_open_page.rb
69
126
  - lib/webrat/core/scope.rb
70
127
  - lib/webrat/core/session.rb
71
- - lib/webrat/core/xml/hpricot.rb
72
- - lib/webrat/core/xml/nokogiri.rb
73
- - lib/webrat/core/xml/rexml.rb
74
128
  - lib/webrat/core/xml.rb
75
- - lib/webrat/core.rb
76
129
  - lib/webrat/core_extensions/blank.rb
77
130
  - lib/webrat/core_extensions/deprecate.rb
78
131
  - lib/webrat/core_extensions/detect_mapped.rb
79
132
  - lib/webrat/core_extensions/meta_class.rb
80
133
  - lib/webrat/core_extensions/nil_to_param.rb
81
134
  - lib/webrat/core_extensions/tcp_socket.rb
82
- - lib/webrat/mechanize.rb
135
+ - lib/webrat/integrations/merb.rb
136
+ - lib/webrat/integrations/rails.rb
137
+ - lib/webrat/integrations/rspec-rails.rb
138
+ - lib/webrat/integrations/selenium.rb
83
139
  - lib/webrat/merb.rb
84
- - lib/webrat/merb_multipart_support.rb
85
- - lib/webrat/merb_session.rb
86
- - lib/webrat/rack.rb
87
- - lib/webrat/rack_test.rb
88
- - lib/webrat/rails.rb
89
140
  - lib/webrat/rspec-rails.rb
141
+ - lib/webrat/selenium.rb
90
142
  - lib/webrat/selenium/application_server_factory.rb
143
+ - lib/webrat/selenium/application_servers.rb
91
144
  - lib/webrat/selenium/application_servers/base.rb
92
145
  - lib/webrat/selenium/application_servers/external.rb
93
146
  - lib/webrat/selenium/application_servers/merb.rb
94
147
  - lib/webrat/selenium/application_servers/rails.rb
95
148
  - lib/webrat/selenium/application_servers/sinatra.rb
96
- - lib/webrat/selenium/application_servers.rb
97
149
  - lib/webrat/selenium/location_strategy_javascript/button.js
98
150
  - lib/webrat/selenium/location_strategy_javascript/label.js
99
151
  - lib/webrat/selenium/location_strategy_javascript/webrat.js
100
152
  - lib/webrat/selenium/location_strategy_javascript/webratlink.js
101
153
  - lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js
102
154
  - lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js
155
+ - lib/webrat/selenium/matchers.rb
103
156
  - lib/webrat/selenium/matchers/have_content.rb
104
157
  - lib/webrat/selenium/matchers/have_selector.rb
105
158
  - lib/webrat/selenium/matchers/have_tag.rb
106
159
  - lib/webrat/selenium/matchers/have_xpath.rb
107
- - lib/webrat/selenium/matchers.rb
108
160
  - lib/webrat/selenium/selenium_extensions.js
109
161
  - lib/webrat/selenium/selenium_rc_server.rb
110
162
  - lib/webrat/selenium/selenium_session.rb
111
163
  - lib/webrat/selenium/silence_stream.rb
112
- - lib/webrat/selenium.rb
113
- - lib/webrat/sinatra.rb
114
- - lib/webrat.rb
164
+ - spec/fakes/test_adapter.rb
165
+ - spec/integration/mechanize/Rakefile
166
+ - spec/integration/mechanize/config.ru
167
+ - spec/integration/mechanize/sample_app.rb
168
+ - spec/integration/mechanize/spec/mechanize_spec.rb
169
+ - spec/integration/mechanize/spec/spec_helper.rb
170
+ - spec/integration/merb/.gitignore
171
+ - spec/integration/merb/Rakefile
172
+ - spec/integration/merb/app/controllers/application.rb
173
+ - spec/integration/merb/app/controllers/exceptions.rb
174
+ - spec/integration/merb/app/controllers/testing.rb
175
+ - spec/integration/merb/app/views/exceptions/not_acceptable.html.erb
176
+ - spec/integration/merb/app/views/exceptions/not_found.html.erb
177
+ - spec/integration/merb/app/views/layout/application.html.erb
178
+ - spec/integration/merb/app/views/testing/show_form.html.erb
179
+ - spec/integration/merb/app/views/testing/upload.html.erb
180
+ - spec/integration/merb/config/environments/development.rb
181
+ - spec/integration/merb/config/environments/rake.rb
182
+ - spec/integration/merb/config/environments/test.rb
183
+ - spec/integration/merb/config/init.rb
184
+ - spec/integration/merb/config/rack.rb
185
+ - spec/integration/merb/config/router.rb
186
+ - spec/integration/merb/spec/spec.opts
187
+ - spec/integration/merb/spec/spec_helper.rb
188
+ - spec/integration/merb/spec/webrat_spec.rb
189
+ - spec/integration/merb/tasks/merb.thor/app_script.rb
190
+ - spec/integration/merb/tasks/merb.thor/common.rb
191
+ - spec/integration/merb/tasks/merb.thor/gem_ext.rb
192
+ - spec/integration/merb/tasks/merb.thor/main.thor
193
+ - spec/integration/merb/tasks/merb.thor/ops.rb
194
+ - spec/integration/merb/tasks/merb.thor/utils.rb
195
+ - spec/integration/rack/Rakefile
196
+ - spec/integration/rack/app.rb
197
+ - spec/integration/rack/test/helper.rb
198
+ - spec/integration/rack/test/webrat_rack_test.rb
199
+ - spec/integration/rails/.gitignore
200
+ - spec/integration/rails/Rakefile
201
+ - spec/integration/rails/app/controllers/application.rb
202
+ - spec/integration/rails/app/controllers/buttons_controller.rb
203
+ - spec/integration/rails/app/controllers/fields_controller.rb
204
+ - spec/integration/rails/app/controllers/links_controller.rb
205
+ - spec/integration/rails/app/controllers/webrat_controller.rb
206
+ - spec/integration/rails/app/helpers/buttons_helper.rb
207
+ - spec/integration/rails/app/helpers/fields_helper.rb
208
+ - spec/integration/rails/app/helpers/links_helper.rb
209
+ - spec/integration/rails/app/views/buttons/show.html.erb
210
+ - spec/integration/rails/app/views/fields/show.html.erb
211
+ - spec/integration/rails/app/views/links/show.html.erb
212
+ - spec/integration/rails/app/views/webrat/before_redirect_form.html.erb
213
+ - spec/integration/rails/app/views/webrat/buttons.html.erb
214
+ - spec/integration/rails/app/views/webrat/form.html.erb
215
+ - spec/integration/rails/app/views/webrat/within.html.erb
216
+ - spec/integration/rails/config/boot.rb
217
+ - spec/integration/rails/config/environment.rb
218
+ - spec/integration/rails/config/environments/development.rb
219
+ - spec/integration/rails/config/environments/selenium.rb
220
+ - spec/integration/rails/config/environments/test.rb
221
+ - spec/integration/rails/config/initializers/inflections.rb
222
+ - spec/integration/rails/config/initializers/mime_types.rb
223
+ - spec/integration/rails/config/initializers/new_rails_defaults.rb
224
+ - spec/integration/rails/config/locales/en.yml
225
+ - spec/integration/rails/config/routes.rb
226
+ - spec/integration/rails/public/404.html
227
+ - spec/integration/rails/public/422.html
228
+ - spec/integration/rails/public/500.html
229
+ - spec/integration/rails/script/about
230
+ - spec/integration/rails/script/console
231
+ - spec/integration/rails/script/dbconsole
232
+ - spec/integration/rails/script/destroy
233
+ - spec/integration/rails/script/generate
234
+ - spec/integration/rails/script/performance/benchmarker
235
+ - spec/integration/rails/script/performance/profiler
236
+ - spec/integration/rails/script/performance/request
237
+ - spec/integration/rails/script/plugin
238
+ - spec/integration/rails/script/process/inspector
239
+ - spec/integration/rails/script/process/reaper
240
+ - spec/integration/rails/script/process/spawner
241
+ - spec/integration/rails/script/runner
242
+ - spec/integration/rails/script/server
243
+ - spec/integration/rails/test/integration/button_click_test.rb
244
+ - spec/integration/rails/test/integration/fill_in_test.rb
245
+ - spec/integration/rails/test/integration/link_click_test.rb
246
+ - spec/integration/rails/test/integration/webrat_test.rb
247
+ - spec/integration/rails/test/test_helper.rb
248
+ - spec/integration/sinatra/Rakefile
249
+ - spec/integration/sinatra/classic_app.rb
250
+ - spec/integration/sinatra/modular_app.rb
251
+ - spec/integration/sinatra/test/classic_app_test.rb
252
+ - spec/integration/sinatra/test/modular_app_test.rb
253
+ - spec/integration/sinatra/test/test_helper.rb
254
+ - spec/private/core/configuration_spec.rb
255
+ - spec/private/core/field_spec.rb
256
+ - spec/private/core/link_spec.rb
257
+ - spec/private/core/session_spec.rb
258
+ - spec/private/mechanize/mechanize_adapter_spec.rb
259
+ - spec/private/nokogiri_spec.rb
260
+ - spec/private/rails/attaches_file_spec.rb
261
+ - spec/private/rails/rails_adapter_spec.rb
262
+ - spec/private/selenium/application_servers/rails_spec.rb
263
+ - spec/public/basic_auth_spec.rb
264
+ - spec/public/check_spec.rb
265
+ - spec/public/choose_spec.rb
266
+ - spec/public/click_area_spec.rb
267
+ - spec/public/click_button_spec.rb
268
+ - spec/public/click_link_spec.rb
269
+ - spec/public/fill_in_spec.rb
270
+ - spec/public/locators/field_by_xpath_spec.rb
271
+ - spec/public/locators/field_labeled_spec.rb
272
+ - spec/public/locators/field_with_id_spec.rb
273
+ - spec/public/matchers/contain_spec.rb
274
+ - spec/public/matchers/have_selector_spec.rb
275
+ - spec/public/matchers/have_tag_spec.rb
276
+ - spec/public/matchers/have_xpath_spec.rb
277
+ - spec/public/reload_spec.rb
278
+ - spec/public/save_and_open_spec.rb
279
+ - spec/public/select_date_spec.rb
280
+ - spec/public/select_datetime_spec.rb
281
+ - spec/public/select_spec.rb
282
+ - spec/public/select_time_spec.rb
283
+ - spec/public/selenium/application_server_factory_spec.rb
284
+ - spec/public/selenium/application_servers/external_spec.rb
285
+ - spec/public/selenium/selenium_session_spec.rb
286
+ - spec/public/set_hidden_field_spec.rb
287
+ - spec/public/submit_form_spec.rb
288
+ - spec/public/visit_spec.rb
289
+ - spec/public/within_spec.rb
290
+ - spec/rcov.opts
291
+ - spec/spec.opts
292
+ - spec/spec_helper.rb
115
293
  - vendor/selenium-server.jar
294
+ - webrat.gemspec
116
295
  has_rdoc: true
117
296
  homepage: http://github.com/brynary/webrat
118
297
  licenses: []
119
298
 
120
299
  post_install_message:
121
- rdoc_options: []
122
-
300
+ rdoc_options:
301
+ - --charset=UTF-8
123
302
  require_paths:
124
303
  - lib
125
304
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -136,10 +315,96 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
315
  version:
137
316
  requirements: []
138
317
 
139
- rubyforge_project: webrat
318
+ rubyforge_project: honkster-webrat
140
319
  rubygems_version: 1.3.5
141
320
  signing_key:
142
321
  specification_version: 3
143
- summary: Webrat. Ruby Acceptance Testing for Web applications
144
- test_files: []
145
-
322
+ summary: Ruby Acceptance Testing for Web applications
323
+ test_files:
324
+ - spec/fakes/test_adapter.rb
325
+ - spec/integration/mechanize/sample_app.rb
326
+ - spec/integration/mechanize/spec/mechanize_spec.rb
327
+ - spec/integration/mechanize/spec/spec_helper.rb
328
+ - spec/integration/merb/app/controllers/application.rb
329
+ - spec/integration/merb/app/controllers/exceptions.rb
330
+ - spec/integration/merb/app/controllers/testing.rb
331
+ - spec/integration/merb/config/environments/development.rb
332
+ - spec/integration/merb/config/environments/rake.rb
333
+ - spec/integration/merb/config/environments/test.rb
334
+ - spec/integration/merb/config/init.rb
335
+ - spec/integration/merb/config/rack.rb
336
+ - spec/integration/merb/config/router.rb
337
+ - spec/integration/merb/spec/spec_helper.rb
338
+ - spec/integration/merb/spec/webrat_spec.rb
339
+ - spec/integration/merb/tasks/merb.thor/app_script.rb
340
+ - spec/integration/merb/tasks/merb.thor/common.rb
341
+ - spec/integration/merb/tasks/merb.thor/gem_ext.rb
342
+ - spec/integration/merb/tasks/merb.thor/ops.rb
343
+ - spec/integration/merb/tasks/merb.thor/utils.rb
344
+ - spec/integration/rack/app.rb
345
+ - spec/integration/rack/test/helper.rb
346
+ - spec/integration/rack/test/webrat_rack_test.rb
347
+ - spec/integration/rails/app/controllers/application.rb
348
+ - spec/integration/rails/app/controllers/buttons_controller.rb
349
+ - spec/integration/rails/app/controllers/fields_controller.rb
350
+ - spec/integration/rails/app/controllers/links_controller.rb
351
+ - spec/integration/rails/app/controllers/webrat_controller.rb
352
+ - spec/integration/rails/app/helpers/buttons_helper.rb
353
+ - spec/integration/rails/app/helpers/fields_helper.rb
354
+ - spec/integration/rails/app/helpers/links_helper.rb
355
+ - spec/integration/rails/config/boot.rb
356
+ - spec/integration/rails/config/environment.rb
357
+ - spec/integration/rails/config/environments/development.rb
358
+ - spec/integration/rails/config/environments/selenium.rb
359
+ - spec/integration/rails/config/environments/test.rb
360
+ - spec/integration/rails/config/initializers/inflections.rb
361
+ - spec/integration/rails/config/initializers/mime_types.rb
362
+ - spec/integration/rails/config/initializers/new_rails_defaults.rb
363
+ - spec/integration/rails/config/routes.rb
364
+ - spec/integration/rails/test/integration/button_click_test.rb
365
+ - spec/integration/rails/test/integration/fill_in_test.rb
366
+ - spec/integration/rails/test/integration/link_click_test.rb
367
+ - spec/integration/rails/test/integration/webrat_test.rb
368
+ - spec/integration/rails/test/test_helper.rb
369
+ - spec/integration/sinatra/classic_app.rb
370
+ - spec/integration/sinatra/modular_app.rb
371
+ - spec/integration/sinatra/test/classic_app_test.rb
372
+ - spec/integration/sinatra/test/modular_app_test.rb
373
+ - spec/integration/sinatra/test/test_helper.rb
374
+ - spec/private/core/configuration_spec.rb
375
+ - spec/private/core/field_spec.rb
376
+ - spec/private/core/link_spec.rb
377
+ - spec/private/core/session_spec.rb
378
+ - spec/private/mechanize/mechanize_adapter_spec.rb
379
+ - spec/private/nokogiri_spec.rb
380
+ - spec/private/rails/attaches_file_spec.rb
381
+ - spec/private/rails/rails_adapter_spec.rb
382
+ - spec/private/selenium/application_servers/rails_spec.rb
383
+ - spec/public/basic_auth_spec.rb
384
+ - spec/public/check_spec.rb
385
+ - spec/public/choose_spec.rb
386
+ - spec/public/click_area_spec.rb
387
+ - spec/public/click_button_spec.rb
388
+ - spec/public/click_link_spec.rb
389
+ - spec/public/fill_in_spec.rb
390
+ - spec/public/locators/field_by_xpath_spec.rb
391
+ - spec/public/locators/field_labeled_spec.rb
392
+ - spec/public/locators/field_with_id_spec.rb
393
+ - spec/public/matchers/contain_spec.rb
394
+ - spec/public/matchers/have_selector_spec.rb
395
+ - spec/public/matchers/have_tag_spec.rb
396
+ - spec/public/matchers/have_xpath_spec.rb
397
+ - spec/public/reload_spec.rb
398
+ - spec/public/save_and_open_spec.rb
399
+ - spec/public/select_date_spec.rb
400
+ - spec/public/select_datetime_spec.rb
401
+ - spec/public/select_spec.rb
402
+ - spec/public/select_time_spec.rb
403
+ - spec/public/selenium/application_server_factory_spec.rb
404
+ - spec/public/selenium/application_servers/external_spec.rb
405
+ - spec/public/selenium/selenium_session_spec.rb
406
+ - spec/public/set_hidden_field_spec.rb
407
+ - spec/public/submit_form_spec.rb
408
+ - spec/public/visit_spec.rb
409
+ - spec/public/within_spec.rb
410
+ - spec/spec_helper.rb
@@ -1,19 +0,0 @@
1
- module Webrat
2
-
3
- def self.hpricot_document(stringlike)
4
- return stringlike.dom if stringlike.respond_to?(:dom)
5
-
6
- if Hpricot::Doc === stringlike
7
- stringlike
8
- elsif Hpricot::Elements === stringlike
9
- stringlike
10
- elsif StringIO === stringlike
11
- Hpricot(stringlike.string)
12
- elsif stringlike.respond_to?(:body)
13
- Hpricot(stringlike.body.to_s)
14
- else
15
- Hpricot(stringlike.to_s)
16
- end
17
- end
18
-
19
- end
@@ -1,76 +0,0 @@
1
- require "webrat/core_extensions/meta_class"
2
-
3
- module Webrat
4
-
5
- def self.nokogiri_document(stringlike) #:nodoc:
6
- return stringlike.dom if stringlike.respond_to?(:dom)
7
-
8
- if Nokogiri::HTML::Document === stringlike
9
- stringlike
10
- elsif Nokogiri::XML::NodeSet === stringlike
11
- stringlike
12
- elsif StringIO === stringlike
13
- Nokogiri::HTML(stringlike.string)
14
- elsif stringlike.respond_to?(:body)
15
- Nokogiri::HTML(stringlike.body.to_s)
16
- else
17
- Nokogiri::HTML(stringlike.to_s)
18
- end
19
- end
20
-
21
- def self.html_nokogiri_document(stringlike) #:nodoc:
22
- return stringlike.dom if stringlike.respond_to?(:dom)
23
-
24
- if Nokogiri::HTML::Document === stringlike
25
- stringlike
26
- elsif Nokogiri::XML::NodeSet === stringlike
27
- stringlike
28
- elsif StringIO === stringlike
29
- Nokogiri::HTML(stringlike.string)
30
- elsif stringlike.respond_to?(:body)
31
- Nokogiri::HTML(stringlike.body.to_s)
32
- else
33
- Nokogiri::HTML(stringlike.to_s)
34
- end
35
- end
36
-
37
- def self.xml_nokogiri_document(stringlike) #:nodoc:
38
- return stringlike.dom if stringlike.respond_to?(:dom)
39
-
40
- if Nokogiri::HTML::Document === stringlike
41
- stringlike
42
- elsif Nokogiri::XML::NodeSet === stringlike
43
- stringlike
44
- elsif StringIO === stringlike
45
- Nokogiri::XML(stringlike.string)
46
- elsif stringlike.respond_to?(:body)
47
- Nokogiri::XML(stringlike.body.to_s)
48
- else
49
- Nokogiri::XML(stringlike.to_s)
50
- end
51
- end
52
-
53
- def self.define_dom_method(object, dom) #:nodoc:
54
- object.meta_class.send(:define_method, :dom) do
55
- dom
56
- end
57
- end
58
-
59
- end
60
-
61
-
62
- module Nokogiri #:nodoc:
63
- module CSS #:nodoc:
64
- class XPathVisitor #:nodoc:
65
-
66
- def visit_pseudo_class_text(node) #:nodoc:
67
- "@type='text'"
68
- end
69
-
70
- def visit_pseudo_class_password(node) #:nodoc:
71
- "@type='password'"
72
- end
73
-
74
- end
75
- end
76
- end
@@ -1,24 +0,0 @@
1
- module Webrat
2
-
3
- def self.rexml_document(stringlike)
4
- stringlike = stringlike.body.to_s if stringlike.respond_to?(:body)
5
-
6
- case stringlike
7
- when REXML::Document
8
- stringlike.root
9
- when REXML::Node, Array
10
- stringlike
11
- else
12
- begin
13
- REXML::Document.new(stringlike.to_s).root
14
- rescue REXML::ParseException => e
15
- if e.message.include?("second root element")
16
- REXML::Document.new("<fake-root-element>#{stringlike}</fake-root-element>").root
17
- else
18
- raise e
19
- end
20
- end
21
- end
22
- end
23
-
24
- end
@@ -1,27 +0,0 @@
1
- module Webrat
2
-
3
- # These methods are copied from merb-core/two-oh.rb which defines new
4
- # multipart_post and multipart_put methods for Merb::Test::MultipartRequestHelper.
5
- # We can't require two-oh.rb because it alters Merb's own behavior, causing
6
- # failing specs in Merb when Webrat is required.
7
- module MerbMultipartSupport
8
- def multipart_request(path, params = {}, env = {})
9
- multipart = Merb::Test::MultipartRequestHelper::Post.new(params)
10
- body, head = multipart.to_multipart
11
- env["CONTENT_TYPE"] = head
12
- env["CONTENT_LENGTH"] = body.size
13
- env[:input] = StringIO.new(body)
14
- request(path, env)
15
- end
16
-
17
- def multipart_post(path, params = {}, env = {})
18
- env[:method] = "POST"
19
- multipart_request(path, params, env)
20
- end
21
-
22
- def multipart_put(path, params = {}, env = {}, &block)
23
- env[:method] = "PUT"
24
- multipart_request(path, params, env)
25
- end
26
- end
27
- end
@@ -1,80 +0,0 @@
1
- require "webrat"
2
- require "merb-core"
3
- require "webrat/merb_multipart_support"
4
-
5
- module Webrat
6
- class MerbSession < Session #:nodoc:
7
- include Merb::Test::MakeRequest
8
-
9
- # Include Webrat's own version of multipart_post/put because the officially
10
- # supported methods in Merb don't perform the request correctly.
11
- include MerbMultipartSupport
12
-
13
- attr_accessor :response
14
-
15
- def get(url, data, headers = nil)
16
- do_request(url, data, headers, "GET")
17
- end
18
-
19
- def post(url, data, headers = nil)
20
- do_request(url, data, headers, "POST")
21
- end
22
-
23
- def put(url, data, headers = nil)
24
- do_request(url, data, headers, "PUT")
25
- end
26
-
27
- def delete(url, data, headers = nil)
28
- do_request(url, data, headers, "DELETE")
29
- end
30
-
31
- def response_body
32
- @response.body.to_s
33
- end
34
-
35
- def response_code
36
- @response.status
37
- end
38
-
39
- def do_request(url, data, headers, method)
40
- if method == "POST" && has_file?(data)
41
- @response = multipart_post(url, data, :headers => headers)
42
-
43
- elsif method == "PUT" && has_file?(data)
44
- @response = multipart_put(url, data, :headers => headers)
45
-
46
- else
47
- @response = request(url,
48
- :params => (data && data.any?) ? data : nil,
49
- :headers => headers,
50
- :method => method)
51
- end
52
- end
53
-
54
- protected
55
-
56
- # Recursively search the data for a file attachment.
57
- def has_file?(data)
58
- data.each do |key, value|
59
- if value.is_a?(Hash)
60
- return has_file?(value)
61
- else
62
- return true if value.is_a?(File)
63
- end
64
- end
65
- return false
66
- end
67
-
68
- end
69
- end
70
-
71
- module Merb #:nodoc:
72
- module Test #:nodoc:
73
- module RequestHelper #:nodoc:
74
- def request(uri, env = {})
75
- @_webrat_session ||= Webrat::MerbSession.new
76
- @_webrat_session.response = @_webrat_session.request(uri, env)
77
- end
78
- end
79
- end
80
- end
data/lib/webrat/rack.rb DELETED
@@ -1,24 +0,0 @@
1
- require 'webrat'
2
-
3
- class CGIMethods #:nodoc:
4
- def self.parse_query_parameters(params)
5
- hash = {}
6
- params.split('&').each do |p|
7
- pair = p.split('=')
8
- hash[pair[0]] = pair[1]
9
- end
10
- hash
11
- end
12
- end
13
-
14
- module Webrat
15
- class RackSession < Session #:nodoc:
16
- def response_body
17
- @response.body
18
- end
19
-
20
- def response_code
21
- @response.status
22
- end
23
- end
24
- end