davidtrogers-webrat 0.4.4.1 → 0.4.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. data/.document +4 -0
  2. data/.dotest/0001 +34 -0
  3. data/.dotest/0002 +34 -0
  4. data/.dotest/binary +1 -0
  5. data/.dotest/final-commit +1 -0
  6. data/.dotest/head-name +1 -0
  7. data/.dotest/info +5 -0
  8. data/.dotest/keep +1 -0
  9. data/.dotest/last +1 -0
  10. data/.dotest/msg +0 -0
  11. data/.dotest/msg-clean +0 -0
  12. data/.dotest/next +1 -0
  13. data/.dotest/onto +1 -0
  14. data/.dotest/orig-head +1 -0
  15. data/.dotest/patch +29 -0
  16. data/.dotest/sign +1 -0
  17. data/.dotest/utf8 +1 -0
  18. data/.dotest/whitespace +1 -0
  19. data/.gitignore +16 -0
  20. data/History.txt +8 -0
  21. data/Rakefile +207 -160
  22. data/VERSION +1 -0
  23. data/lib/webrat.rb +31 -0
  24. data/lib/webrat/core.rb +14 -0
  25. data/lib/webrat/core/configuration.rb +102 -0
  26. data/lib/webrat/core/elements/area.rb +31 -0
  27. data/lib/webrat/core/elements/element.rb +33 -0
  28. data/lib/webrat/core/elements/field.rb +405 -0
  29. data/lib/webrat/core/elements/form.rb +103 -0
  30. data/lib/webrat/core/elements/label.rb +31 -0
  31. data/lib/webrat/core/elements/link.rb +92 -0
  32. data/lib/webrat/core/elements/select_option.rb +35 -0
  33. data/lib/webrat/core/locators.rb +20 -0
  34. data/lib/webrat/core/locators/area_locator.rb +38 -0
  35. data/lib/webrat/core/locators/button_locator.rb +54 -0
  36. data/lib/webrat/core/locators/field_by_id_locator.rb +37 -0
  37. data/lib/webrat/core/locators/field_labeled_locator.rb +56 -0
  38. data/lib/webrat/core/locators/field_locator.rb +25 -0
  39. data/lib/webrat/core/locators/field_named_locator.rb +41 -0
  40. data/lib/webrat/core/locators/form_locator.rb +19 -0
  41. data/lib/webrat/core/locators/label_locator.rb +34 -0
  42. data/lib/webrat/core/locators/link_locator.rb +66 -0
  43. data/lib/webrat/core/locators/locator.rb +20 -0
  44. data/lib/webrat/core/locators/select_option_locator.rb +59 -0
  45. data/lib/webrat/core/logging.rb +24 -0
  46. data/lib/webrat/core/matchers.rb +4 -0
  47. data/lib/webrat/core/matchers/have_content.rb +73 -0
  48. data/lib/webrat/core/matchers/have_selector.rb +74 -0
  49. data/lib/webrat/core/matchers/have_tag.rb +21 -0
  50. data/lib/webrat/core/matchers/have_xpath.rb +147 -0
  51. data/lib/webrat/core/methods.rb +63 -0
  52. data/lib/webrat/core/mime.rb +29 -0
  53. data/lib/webrat/core/save_and_open_page.rb +50 -0
  54. data/lib/webrat/core/scope.rb +350 -0
  55. data/lib/webrat/core/session.rb +290 -0
  56. data/lib/webrat/core/xml.rb +115 -0
  57. data/lib/webrat/core/xml/hpricot.rb +19 -0
  58. data/lib/webrat/core/xml/nokogiri.rb +76 -0
  59. data/lib/webrat/core/xml/rexml.rb +24 -0
  60. data/lib/webrat/core_extensions/blank.rb +58 -0
  61. data/lib/webrat/core_extensions/deprecate.rb +8 -0
  62. data/lib/webrat/core_extensions/detect_mapped.rb +12 -0
  63. data/lib/webrat/core_extensions/meta_class.rb +6 -0
  64. data/lib/webrat/core_extensions/nil_to_param.rb +5 -0
  65. data/lib/webrat/core_extensions/tcp_socket.rb +27 -0
  66. data/lib/webrat/mechanize.rb +74 -0
  67. data/lib/webrat/merb.rb +9 -0
  68. data/lib/webrat/merb_session.rb +65 -0
  69. data/lib/webrat/rack.rb +24 -0
  70. data/lib/webrat/rack_test.rb +32 -0
  71. data/lib/webrat/rails.rb +105 -0
  72. data/lib/webrat/rspec-rails.rb +13 -0
  73. data/lib/webrat/selenium.rb +81 -0
  74. data/lib/webrat/selenium/application_server.rb +73 -0
  75. data/lib/webrat/selenium/location_strategy_javascript/button.js +19 -0
  76. data/lib/webrat/selenium/location_strategy_javascript/label.js +15 -0
  77. data/lib/webrat/selenium/location_strategy_javascript/webrat.js +5 -0
  78. data/lib/webrat/selenium/location_strategy_javascript/webratlink.js +12 -0
  79. data/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +15 -0
  80. data/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +5 -0
  81. data/lib/webrat/selenium/matchers.rb +4 -0
  82. data/lib/webrat/selenium/matchers/have_content.rb +66 -0
  83. data/lib/webrat/selenium/matchers/have_selector.rb +49 -0
  84. data/lib/webrat/selenium/matchers/have_tag.rb +72 -0
  85. data/lib/webrat/selenium/matchers/have_xpath.rb +45 -0
  86. data/lib/webrat/selenium/merb_application_server.rb +48 -0
  87. data/lib/webrat/selenium/rails_application_server.rb +42 -0
  88. data/lib/webrat/selenium/selenium_extensions.js +6 -0
  89. data/lib/webrat/selenium/selenium_rc_server.rb +84 -0
  90. data/lib/webrat/selenium/selenium_session.rb +238 -0
  91. data/lib/webrat/selenium/silence_stream.rb +18 -0
  92. data/lib/webrat/selenium/sinatra_application_server.rb +35 -0
  93. data/lib/webrat/sinatra.rb +44 -0
  94. data/spec/fakes/test_session.rb +34 -0
  95. data/spec/integration/merb/.gitignore +21 -0
  96. data/spec/integration/merb/Rakefile +35 -0
  97. data/spec/integration/merb/app/controllers/application.rb +2 -0
  98. data/spec/integration/merb/app/controllers/exceptions.rb +13 -0
  99. data/spec/integration/merb/app/controllers/testing.rb +18 -0
  100. data/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +63 -0
  101. data/spec/integration/merb/app/views/exceptions/not_found.html.erb +47 -0
  102. data/spec/integration/merb/app/views/layout/application.html.erb +12 -0
  103. data/spec/integration/merb/app/views/testing/show_form.html.erb +27 -0
  104. data/spec/integration/merb/config/environments/development.rb +15 -0
  105. data/spec/integration/merb/config/environments/rake.rb +11 -0
  106. data/spec/integration/merb/config/environments/test.rb +14 -0
  107. data/spec/integration/merb/config/init.rb +25 -0
  108. data/spec/integration/merb/config/rack.rb +11 -0
  109. data/spec/integration/merb/config/router.rb +33 -0
  110. data/spec/integration/merb/spec/spec.opts +1 -0
  111. data/spec/integration/merb/spec/spec_helper.rb +24 -0
  112. data/spec/integration/merb/spec/webrat_spec.rb +32 -0
  113. data/spec/integration/merb/tasks/merb.thor/app_script.rb +31 -0
  114. data/spec/integration/merb/tasks/merb.thor/common.rb +64 -0
  115. data/spec/integration/merb/tasks/merb.thor/gem_ext.rb +124 -0
  116. data/spec/integration/merb/tasks/merb.thor/main.thor +150 -0
  117. data/spec/integration/merb/tasks/merb.thor/ops.rb +93 -0
  118. data/spec/integration/merb/tasks/merb.thor/utils.rb +40 -0
  119. data/spec/integration/rack/Rakefile +5 -0
  120. data/spec/integration/rack/rack_app.rb +16 -0
  121. data/spec/integration/rack/test/test_helper.rb +20 -0
  122. data/spec/integration/rack/test/webrat_rack_test.rb +67 -0
  123. data/spec/integration/rails/.gitignore +3 -0
  124. data/spec/integration/rails/Rakefile +30 -0
  125. data/spec/integration/rails/app/controllers/application.rb +15 -0
  126. data/spec/integration/rails/app/controllers/buttons_controller.rb +7 -0
  127. data/spec/integration/rails/app/controllers/fields_controller.rb +4 -0
  128. data/spec/integration/rails/app/controllers/links_controller.rb +7 -0
  129. data/spec/integration/rails/app/controllers/webrat_controller.rb +39 -0
  130. data/spec/integration/rails/app/helpers/buttons_helper.rb +2 -0
  131. data/spec/integration/rails/app/helpers/fields_helper.rb +2 -0
  132. data/spec/integration/rails/app/helpers/links_helper.rb +2 -0
  133. data/spec/integration/rails/app/views/buttons/show.html.erb +11 -0
  134. data/spec/integration/rails/app/views/fields/show.html.erb +9 -0
  135. data/spec/integration/rails/app/views/links/show.html.erb +4 -0
  136. data/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +4 -0
  137. data/spec/integration/rails/app/views/webrat/buttons.html.erb +11 -0
  138. data/spec/integration/rails/app/views/webrat/form.html.erb +28 -0
  139. data/spec/integration/rails/config/boot.rb +109 -0
  140. data/spec/integration/rails/config/environment.rb +12 -0
  141. data/spec/integration/rails/config/environments/development.rb +17 -0
  142. data/spec/integration/rails/config/environments/selenium.rb +22 -0
  143. data/spec/integration/rails/config/environments/test.rb +22 -0
  144. data/spec/integration/rails/config/initializers/inflections.rb +10 -0
  145. data/spec/integration/rails/config/initializers/mime_types.rb +5 -0
  146. data/spec/integration/rails/config/initializers/new_rails_defaults.rb +17 -0
  147. data/spec/integration/rails/config/locales/en.yml +5 -0
  148. data/spec/integration/rails/config/routes.rb +17 -0
  149. data/spec/integration/rails/public/404.html +30 -0
  150. data/spec/integration/rails/public/422.html +30 -0
  151. data/spec/integration/rails/public/500.html +33 -0
  152. data/spec/integration/rails/script/about +4 -0
  153. data/spec/integration/rails/script/console +3 -0
  154. data/spec/integration/rails/script/dbconsole +3 -0
  155. data/spec/integration/rails/script/destroy +3 -0
  156. data/spec/integration/rails/script/generate +3 -0
  157. data/spec/integration/rails/script/performance/benchmarker +3 -0
  158. data/spec/integration/rails/script/performance/profiler +3 -0
  159. data/spec/integration/rails/script/performance/request +3 -0
  160. data/spec/integration/rails/script/plugin +3 -0
  161. data/spec/integration/rails/script/process/inspector +3 -0
  162. data/spec/integration/rails/script/process/reaper +3 -0
  163. data/spec/integration/rails/script/process/spawner +3 -0
  164. data/spec/integration/rails/script/runner +3 -0
  165. data/spec/integration/rails/script/server +3 -0
  166. data/spec/integration/rails/test/integration/button_click_test.rb +80 -0
  167. data/spec/integration/rails/test/integration/fill_in_test.rb +24 -0
  168. data/spec/integration/rails/test/integration/link_click_test.rb +21 -0
  169. data/spec/integration/rails/test/integration/webrat_test.rb +75 -0
  170. data/spec/integration/rails/test/test_helper.rb +25 -0
  171. data/spec/integration/sinatra/Rakefile +5 -0
  172. data/spec/integration/sinatra/classic_app.rb +64 -0
  173. data/spec/integration/sinatra/modular_app.rb +16 -0
  174. data/spec/integration/sinatra/test/classic_app_test.rb +37 -0
  175. data/spec/integration/sinatra/test/modular_app_test.rb +18 -0
  176. data/spec/integration/sinatra/test/test_helper.rb +16 -0
  177. data/spec/private/core/configuration_spec.rb +106 -0
  178. data/spec/private/core/field_spec.rb +85 -0
  179. data/spec/private/core/link_spec.rb +24 -0
  180. data/spec/private/core/logging_spec.rb +10 -0
  181. data/spec/private/core/session_spec.rb +198 -0
  182. data/spec/private/mechanize/mechanize_session_spec.rb +81 -0
  183. data/spec/private/merb/merb_session_spec.rb +42 -0
  184. data/spec/private/nokogiri_spec.rb +77 -0
  185. data/spec/private/rails/attaches_file_spec.rb +81 -0
  186. data/spec/private/rails/rails_session_spec.rb +110 -0
  187. data/spec/public/basic_auth_spec.rb +24 -0
  188. data/spec/public/check_spec.rb +191 -0
  189. data/spec/public/choose_spec.rb +118 -0
  190. data/spec/public/click_area_spec.rb +106 -0
  191. data/spec/public/click_button_spec.rb +496 -0
  192. data/spec/public/click_link_spec.rb +511 -0
  193. data/spec/public/fill_in_spec.rb +209 -0
  194. data/spec/public/locators/field_by_xpath_spec.rb +19 -0
  195. data/spec/public/locators/field_labeled_spec.rb +172 -0
  196. data/spec/public/locators/field_with_id_spec.rb +16 -0
  197. data/spec/public/matchers/contain_spec.rb +114 -0
  198. data/spec/public/matchers/have_selector_spec.rb +142 -0
  199. data/spec/public/matchers/have_tag_spec.rb +39 -0
  200. data/spec/public/matchers/have_xpath_spec.rb +136 -0
  201. data/spec/public/reload_spec.rb +10 -0
  202. data/spec/public/save_and_open_spec.rb +51 -0
  203. data/spec/public/select_date_spec.rb +112 -0
  204. data/spec/public/select_datetime_spec.rb +137 -0
  205. data/spec/public/select_spec.rb +249 -0
  206. data/spec/public/select_time_spec.rb +100 -0
  207. data/spec/public/set_hidden_field_spec.rb +5 -0
  208. data/spec/public/submit_form_spec.rb +5 -0
  209. data/spec/public/visit_spec.rb +58 -0
  210. data/spec/public/within_spec.rb +177 -0
  211. data/spec/rcov.opts +1 -0
  212. data/spec/spec.opts +2 -0
  213. data/spec/spec_helper.rb +50 -0
  214. data/vendor/selenium-server.jar +0 -0
  215. metadata +309 -16
data/.document ADDED
@@ -0,0 +1,4 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ History.txt
4
+ MIT-LICENSE.txt
data/.dotest/0001 ADDED
@@ -0,0 +1,34 @@
1
+ From ccdd07219286155c63e4db295aebcb768bc275bf Mon Sep 17 00:00:00 2001
2
+ From: davidtrogers <david.t.rogers@gmail.com>
3
+ Date: Tue, 26 May 2009 22:17:55 -0400
4
+ Subject: trying yet again to build this gem :-)
5
+
6
+ ---
7
+ VERSION | 2 +-
8
+ webrat.gemspec | 2 +-
9
+ 2 files changed, 2 insertions(+), 2 deletions(-)
10
+
11
+ diff --git a/VERSION b/VERSION
12
+ index 3b77b494a2e70cf4aa2800eab1e9b1cb6572afc4..77d6f4ca23711533e724789a0a0045eab28c5ea6 100644
13
+ --- a/VERSION
14
+ +++ b/VERSION
15
+ @@ -1 +1 @@
16
+ -0.4.4.2
17
+ +0.0.0
18
+ diff --git a/webrat.gemspec b/webrat.gemspec
19
+ index 752a14ff8fca2cae03a148e2ad2badfe80989cb6..d9061e244f0107ac06e3479a58c4e326d497bdfe 100644
20
+ --- a/webrat.gemspec
21
+ +++ b/webrat.gemspec
22
+ @@ -2,7 +2,7 @@
23
+
24
+ Gem::Specification.new do |s|
25
+ s.name = %q{webrat}
26
+ - s.version = "0.4.4.2"
27
+ + s.version = "0.0.0"
28
+
29
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
30
+ s.authors = ["Dave Rogers"]
31
+ --
32
+ 1.5.4.3
33
+
34
+
data/.dotest/0002 ADDED
@@ -0,0 +1,34 @@
1
+ From 2581869c832668aacf48e2e6dd7212721a6edceb Mon Sep 17 00:00:00 2001
2
+ From: davidtrogers <david.t.rogers@gmail.com>
3
+ Date: Tue, 26 May 2009 22:20:13 -0400
4
+ Subject: trying again
5
+
6
+ ---
7
+ webrat.gemspec | 4 ++--
8
+ 1 files changed, 2 insertions(+), 2 deletions(-)
9
+
10
+ diff --git a/webrat.gemspec b/webrat.gemspec
11
+ index d9061e244f0107ac06e3479a58c4e326d497bdfe..764cf448b3bf7c6cf44086e4783df0ddb3cb5cd3 100644
12
+ --- a/webrat.gemspec
13
+ +++ b/webrat.gemspec
14
+ @@ -7,7 +7,7 @@ Gem::Specification.new do |s|
15
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
16
+ s.authors = ["Dave Rogers"]
17
+ s.date = %q{2009-05-26}
18
+ - s.description = %q{"webrat rules"}
19
+ + s.description = %q{webrat rocks the house}
20
+ s.email = %q{david.t.rogers@gmail.com}
21
+ s.extra_rdoc_files = [
22
+ "README.rdoc"
23
+ @@ -206,7 +206,7 @@ Gem::Specification.new do |s|
24
+ s.rdoc_options = ["--charset=UTF-8"]
25
+ s.require_paths = ["lib"]
26
+ s.rubygems_version = %q{1.3.3}
27
+ - s.summary = %q{"Webrat rules the school"}
28
+ + s.summary = %q{webrat rocks}
29
+ s.test_files = [
30
+ "spec/integration/sinatra/classic_app.rb",
31
+ "spec/integration/sinatra/modular_app.rb",
32
+ --
33
+ 1.5.4.3
34
+
data/.dotest/binary ADDED
@@ -0,0 +1 @@
1
+ t
@@ -0,0 +1 @@
1
+ trying yet again to build this gem :-)
data/.dotest/head-name ADDED
@@ -0,0 +1 @@
1
+ refs/heads/master
data/.dotest/info ADDED
@@ -0,0 +1,5 @@
1
+ Author: davidtrogers
2
+ Email: david.t.rogers@gmail.com
3
+ Subject: trying yet again to build this gem :-)
4
+ Date: Tue, 26 May 2009 22:17:55 -0400
5
+
data/.dotest/keep ADDED
@@ -0,0 +1 @@
1
+ t
data/.dotest/last ADDED
@@ -0,0 +1 @@
1
+ 2
data/.dotest/msg ADDED
File without changes
data/.dotest/msg-clean ADDED
File without changes
data/.dotest/next ADDED
@@ -0,0 +1 @@
1
+ 1
data/.dotest/onto ADDED
@@ -0,0 +1 @@
1
+ 4c5649e84445bdb08fb834705ec6793c831a85cc
data/.dotest/orig-head ADDED
@@ -0,0 +1 @@
1
+ 2581869c832668aacf48e2e6dd7212721a6edceb
data/.dotest/patch ADDED
@@ -0,0 +1,29 @@
1
+ ---
2
+ VERSION | 2 +-
3
+ webrat.gemspec | 2 +-
4
+ 2 files changed, 2 insertions(+), 2 deletions(-)
5
+
6
+ diff --git a/VERSION b/VERSION
7
+ index 3b77b494a2e70cf4aa2800eab1e9b1cb6572afc4..77d6f4ca23711533e724789a0a0045eab28c5ea6 100644
8
+ --- a/VERSION
9
+ +++ b/VERSION
10
+ @@ -1 +1 @@
11
+ -0.4.4.2
12
+ +0.0.0
13
+ diff --git a/webrat.gemspec b/webrat.gemspec
14
+ index 752a14ff8fca2cae03a148e2ad2badfe80989cb6..d9061e244f0107ac06e3479a58c4e326d497bdfe 100644
15
+ --- a/webrat.gemspec
16
+ +++ b/webrat.gemspec
17
+ @@ -2,7 +2,7 @@
18
+
19
+ Gem::Specification.new do |s|
20
+ s.name = %q{webrat}
21
+ - s.version = "0.4.4.2"
22
+ + s.version = "0.0.0"
23
+
24
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
25
+ s.authors = ["Dave Rogers"]
26
+ --
27
+ 1.5.4.3
28
+
29
+
data/.dotest/sign ADDED
@@ -0,0 +1 @@
1
+
data/.dotest/utf8 ADDED
@@ -0,0 +1 @@
1
+ t
@@ -0,0 +1 @@
1
+
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ coverage
2
+ *.gem
3
+ .DS_Store
4
+ pkg
5
+ doc
6
+ ri
7
+ email.txt
8
+ .svn
9
+ log
10
+ .project
11
+ .loadpath
12
+ *.swp
13
+ results
14
+ test_apps
15
+ *.tmproj
16
+ *.log
data/History.txt CHANGED
@@ -11,6 +11,14 @@
11
11
  * Filled in tests on click link lh 195 (diabolo)
12
12
  * Added current_url to selenium session lh 215 (Luke Amdor)
13
13
  * Added silence spec to selenium lh 238 (Martin Gamsjaeger aka snusnu)
14
+ * Added ability to configure the browser startup timeout for selenium lh 242 (Mike Gaffney, Mark Dodwell)
15
+ * Added delegation for field_named lh194 (pivotal labs)
16
+ * Added fix to keep from escaping field values in mechanize mode lh256 (jish)
17
+ * Adding fixes for click button/link and made the integration specs pass for the same in selenium lh254 (Ldiehl, Matthias Marschall)
18
+ * Adding clicking link by id in selenium mode lh221 (larrytheliquid)
19
+ * Adding fix for have_selector and have_xpath in descendent blocks lh234 (Thomas Jack)
20
+ * Adding fix for fields with labels with special characters (Thomas Jack, Mike Gaffney, Bryan Hemlkamp)
21
+ * Deprecated current_page lh50 (Mike Gaffney)
14
22
 
15
23
  == 0.4.4 / 2009-04-06
16
24
 
data/Rakefile CHANGED
@@ -1,164 +1,211 @@
1
- # require 'rubygems'
2
- require "rake/gempackagetask"
3
- require 'rake/rdoctask'
4
- require "rake/clean"
5
- require 'spec'
6
- require 'spec/rake/spectask'
7
- require 'spec/rake/verify_rcov'
8
- require File.expand_path('./lib/webrat.rb')
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "webrat"
8
+ #gem.executables = "steamer"
9
+ gem.summary = %Q{modified version of webrat}
10
+ gem.email = "david.t.rogers@gmail.com"
11
+ gem.homepage = "http://github.com/davidtrogers/webrat"
12
+ gem.authors = ["brynary"]
13
+ # gem.version = "#{version}.#{Time.now.to_i}"
14
+ gem.rdoc_options = ["--inline-source", "--charset=UTF-8"]
15
+ gem.require_paths = ["lib"]
16
+ gem.rubygems_version = %q{1.3.3}
17
+ gem.add_dependency "activerecord"
18
+ # puts "version: #{version}.#{Time.now.to_i}"
19
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
20
+ # if s.respond_to? :specification_version then
21
+ # current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
+ # s.specification_version = 2
23
+ # if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
24
+ # else
25
+ # end
26
+ # else
27
+ # end
28
+ end
29
+
30
+ rescue LoadError
31
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
32
+ end
9
33
 
34
+ # require 'rubygems'
35
+ # require "rake/gempackagetask"
36
+ # require 'rake/rdoctask'
37
+ # require "rake/clean"
38
+ # require 'spec'
39
+ # require 'spec/rake/spectask'
40
+ # require 'spec/rake/verify_rcov'
41
+ # require File.expand_path('./lib/webrat.rb')
42
+
10
43
  ##############################################################################
11
44
  # Package && release
12
45
  ##############################################################################
13
- #spec = Gem::Specification.new do |s|
14
- # s.name = "webrat"
15
- # s.version = Webrat::VERSION
16
- # s.platform = Gem::Platform::RUBY
17
- # s.author = "Bryan Helmkamp/Dave Rogers"
18
- # s.email = "david.t.rogers" + "@" + "gmail.com"
19
- # s.homepage = "http://github.com/davidtrogers/webrat"
20
- # s.summary = "Webrat. Ruby Acceptance Testing for Web applications"
21
- # s.bindir = "bin"
22
- # s.description = s.summary
23
- # s.require_path = "lib"
24
- # s.files = %w(History.txt install.rb MIT-LICENSE.txt README.rdoc Rakefile) + Dir["lib/**/*"] + Dir["vendor/**/*"]
25
-
26
- # rdoc
27
- # s.has_rdoc = true
28
- # s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
29
-
30
- # Dependencies
31
- # s.add_dependency "nokogiri", ">= 1.2.0"
32
-
33
- # s.rubyforge_project = "webrat"
34
- #end
35
-
36
- #Rake::GemPackageTask.new(spec) do |package|
37
- # package.gem_spec = spec
38
- #end
39
-
40
- desc 'Show information about the gem.'
41
- task :debug_gem do
42
- # puts spec.to_ruby
43
- end
44
-
45
- CLEAN.include ["pkg", "*.gem", "doc", "ri", "coverage"]
46
-
47
- desc "Upload rdoc to brynary.com"
48
- task :publish_rdoc => :docs do
49
- sh "scp -r doc/ brynary.com:/apps/uploads/webrat"
50
- end
51
-
52
- desc "Run API and Core specs"
53
- Spec::Rake::SpecTask.new do |t|
54
- t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
55
- t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb']
56
- end
57
-
58
- desc "Run all specs in spec directory with RCov"
59
- Spec::Rake::SpecTask.new(:rcov) do |t|
60
- t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
61
- t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb']
62
- t.rcov = true
63
- t.rcov_opts = lambda do
64
- IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
65
- end
66
- end
67
-
68
- RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
69
- t.threshold = 96.2 # Make sure you have rcov 0.7 or higher!
70
- end
71
-
72
- desc 'Install the package as a gem.'
73
- task :install_gem => [:clean, :package] do
74
- gem_filename = Dir['pkg/*.gem'].first
75
- sh "sudo gem install --no-rdoc --no-ri --local #{gem_filename}"
76
- end
77
-
78
- desc "Delete generated RDoc"
79
- task :clobber_docs do
80
- FileUtils.rm_rf("doc")
81
- end
82
-
83
- desc "Generate RDoc"
84
- task :docs => :clobber_docs do
85
- system "hanna --title 'Webrat #{Webrat::VERSION} API Documentation'"
86
- end
87
-
88
- desc "Run specs using jruby"
89
- task "spec:jruby" do
90
- result = system "jruby -S rake spec"
91
- raise "JRuby tests failed" unless result
92
- end
93
-
94
- desc "Run each spec in isolation to test for dependency issues"
95
- task :spec_deps do
96
- Dir["spec/**/*_spec.rb"].each do |test|
97
- if !system("spec #{test} &> /dev/null")
98
- puts "Dependency Issues: #{test}"
99
- end
100
- end
101
- end
102
-
103
- task :prepare do
104
- system "ln -s ../../../../.. ./spec/integration/rails/vendor/plugins/webrat"
105
- end
106
-
107
- namespace :spec do
108
- desc "Run the integration specs"
109
- task :integration => ["integration:rails", "integration:merb", "integration:sinatra", "integration:rack"]
110
-
111
- namespace :integration do
112
- desc "Run the Rails integration specs"
113
- task :rails => ['rails:webrat'] #,'rails:selenium'] currently not running selenium as it doesn't pass.
114
-
115
- namespace :rails do
116
- task :selenium do
117
- Dir.chdir "spec/integration/rails" do
118
- result = system "rake test_unit:selenium"
119
- raise "Rails integration tests failed" unless result
120
- end
121
- end
122
-
123
- task :webrat do
124
- Dir.chdir "spec/integration/rails" do
125
- result = system "rake test_unit:rails"
126
- raise "Rails integration tests failed" unless result
127
- end
128
- end
129
- end
130
-
131
- desc "Run the Merb integration specs"
132
- task :merb do
133
- Dir.chdir "spec/integration/merb" do
134
- result = system "rake spec"
135
- raise "Merb integration tests failed" unless result
136
- end
137
- end
138
-
139
- desc "Run the Sinatra integration specs"
140
- task :sinatra do
141
- Dir.chdir "spec/integration/sinatra" do
142
- result = system "rake test"
143
- raise "Sinatra integration tests failed" unless result
144
- end
145
- end
146
-
147
- desc "Run the Sinatra integration specs"
148
- task :rack do
149
- Dir.chdir "spec/integration/rack" do
150
- result = system "rake test"
151
- raise "Rack integration tests failed" unless result
152
- end
153
- end
154
- end
155
- end
156
-
157
- task :default => :spec
158
-
159
- task :precommit => ["spec", "spec:jruby", "spec:integration"]
160
-
161
- desc 'Removes trailing whitespace'
162
- task :whitespace do
163
- sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
164
- end
46
+ # spec = Gem::Specification.new do |s|
47
+ # s.name = "webrat"
48
+ # s.version = "#{Webrat::VERSION}.0.#{Time.now.to_i}"
49
+ # s.platform = Gem::Platform::RUBY
50
+ # s.author = "Bryan Helmkamp"
51
+ # s.email = "bryan" + "@" + "brynary.com"
52
+ # s.homepage = "http://github.com/brynary/webrat"
53
+ # s.summary = "Webrat. Ruby Acceptance Testing for Web applications"
54
+ # s.bindir = "bin"
55
+ # s.description = s.summary
56
+ # s.require_path = "lib"
57
+ # s.files = %w(History.txt install.rb MIT-LICENSE.txt README.rdoc Rakefile) + Dir["lib/**/*"] + Dir["vendor/**/*"]
58
+ #
59
+ # # rdoc
60
+ # s.has_rdoc = true
61
+ # s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
62
+ #
63
+ # # Dependencies
64
+ # s.add_dependency "nokogiri", ">= 1.2.0"
65
+ #
66
+ # s.rubyforge_project = "webrat"
67
+ # end
68
+ # #
69
+ #
70
+ # begin
71
+ # require 'jeweler'
72
+ # Jeweler::Tasks.new do |gemspec|
73
+ # gemspec.name = "webrat"
74
+ # gemspec.summary = "webrat rocks the house"
75
+ # gemspec.email = "david.t.rogers@gmail.com"
76
+ # gemspec.homepage = "http://github.com/davidtrogers/webrat"
77
+ # gemspec.description = "TODO"
78
+ # gemspec.authors = ["Dave Rogers"]
79
+ # gemspec.add_dependency "nokogiri", ">= 1.2.0"
80
+ # #
81
+ # # s.rubyforge_project = "webrat"
82
+ # end
83
+ # rescue LoadError
84
+ # puts "Webrat not available."
85
+ # end
86
+ #
87
+ #
88
+ # desc "Generate a gemspec file"
89
+ # task :gemspec do
90
+ # File.open("#{spec.name}.gemspec", 'w') do |f|
91
+ # f.write spec.to_yaml
92
+ # end
93
+ # end
94
+ #
95
+ # Rake::GemPackageTask.new(spec) do |package|
96
+ # package.gem_spec = spec
97
+ # end
98
+ #
99
+ # desc 'Show information about the gem.'
100
+ # task :debug_gem do
101
+ # puts spec.to_ruby
102
+ # end
103
+ #
104
+ # CLEAN.include ["pkg", "*.gem", "doc", "ri", "coverage"]
105
+ #
106
+ # desc "Upload rdoc to brynary.com"
107
+ # task :publish_rdoc => :docs do
108
+ # sh "scp -r doc/ brynary.com:/apps/uploads/webrat"
109
+ # end
110
+ #
111
+ # desc "Run API and Core specs"
112
+ # Spec::Rake::SpecTask.new do |t|
113
+ # t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
114
+ # t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb']
115
+ # end
116
+ #
117
+ # desc "Run all specs in spec directory with RCov"
118
+ # Spec::Rake::SpecTask.new(:rcov) do |t|
119
+ # t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
120
+ # t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb']
121
+ # t.rcov = true
122
+ # t.rcov_opts = lambda do
123
+ # IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
124
+ # end
125
+ # end
126
+ #
127
+ # RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
128
+ # t.threshold = 96.2 # Make sure you have rcov 0.7 or higher!
129
+ # end
130
+ #
131
+ # desc 'Install the package as a gem.'
132
+ # task :install_gem => [:clean, :package] do
133
+ # gem_filename = Dir['pkg/*.gem'].first
134
+ # sh "sudo gem install --no-rdoc --no-ri --local #{gem_filename}"
135
+ # end
136
+ #
137
+ # desc "Delete generated RDoc"
138
+ # task :clobber_docs do
139
+ # FileUtils.rm_rf("doc")
140
+ # end
141
+ #
142
+ # desc "Generate RDoc"
143
+ # task :docs => :clobber_docs do
144
+ # system "hanna --title 'Webrat #{Webrat::VERSION} API Documentation'"
145
+ # end
146
+ #
147
+ # desc "Run specs using jruby"
148
+ # task "spec:jruby" do
149
+ # result = system "jruby -S rake spec"
150
+ # raise "JRuby tests failed" unless result
151
+ # end
152
+ #
153
+ # desc "Run each spec in isolation to test for dependency issues"
154
+ # task :spec_deps do
155
+ # Dir["spec/**/*_spec.rb"].each do |test|
156
+ # if !system("spec #{test} &> /dev/null")
157
+ # puts "Dependency Issues: #{test}"
158
+ # end
159
+ # end
160
+ # end
161
+ #
162
+ # task :prepare do
163
+ # system "ln -s ../../../../.. ./spec/integration/rails/vendor/plugins/webrat"
164
+ # end
165
+ #
166
+ # namespace :spec do
167
+ # desc "Run the integration specs"
168
+ # task :integration => ["integration:rails", "integration:merb", "integration:sinatra"]
169
+ #
170
+ # namespace :integration do
171
+ # desc "Run the Rails integration specs"
172
+ # task :rails => ['rails:webrat'] #,'rails:selenium'] currently not running selenium as it doesn't pass.
173
+ #
174
+ # namespace :rails do
175
+ # task :selenium do
176
+ # Dir.chdir "spec/integration/rails" do
177
+ # result = system "rake test_unit:selenium"
178
+ # raise "Rails integration tests failed" unless result
179
+ # end
180
+ # end
181
+ #
182
+ # task :webrat do
183
+ # Dir.chdir "spec/integration/rails" do
184
+ # result = system "rake test_unit:rails"
185
+ # raise "Rails integration tests failed" unless result
186
+ # end
187
+ # end
188
+ # end
189
+ #
190
+ # desc "Run the Merb integration specs"
191
+ # task :merb do
192
+ # Dir.chdir "spec/integration/merb" do
193
+ # result = system "rake spec"
194
+ # raise "Merb integration tests failed" unless result
195
+ # end
196
+ # end
197
+ #
198
+ # desc "Run the Sinatra integration specs"
199
+ # task :sinatra do
200
+ # Dir.chdir "spec/integration/sinatra" do
201
+ # result = system "rake test"
202
+ # raise "Sinatra tntegration tests failed" unless result
203
+ # end
204
+ # end
205
+ # end
206
+ # end
207
+ #
208
+ # task :default => :spec
209
+ #
210
+ # task :precommit => ["spec", "spec:jruby", "spec:integration"]
211
+ #