integrity 0.1.9 → 0.1.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. data/Rakefile +57 -31
  2. data/config/heroku/.gems +4 -0
  3. data/config/heroku/Rakefile +6 -0
  4. data/config/heroku/config.ru +7 -0
  5. data/config/heroku/integrity-config.rb +11 -0
  6. data/integrity.gemspec +123 -0
  7. data/lib/integrity.rb +7 -14
  8. data/lib/integrity/installer.rb +45 -35
  9. data/lib/integrity/notifier/test.rb +59 -0
  10. data/lib/integrity/notifier/test/fixtures.rb +108 -0
  11. data/lib/integrity/notifier/test/hpricot_matcher.rb +38 -0
  12. data/test/acceptance/build_notifications_test.rb +2 -2
  13. data/test/acceptance/installer_test.rb +25 -7
  14. data/test/helpers.rb +1 -1
  15. data/test/helpers/acceptance.rb +1 -4
  16. data/test/helpers/fixtures.rb +0 -22
  17. data/test/unit/notifier/test_test.rb +29 -0
  18. data/test/unit/project_builder_test.rb +4 -1
  19. data/vendor/sinatra-ditties/README.rdoc +3 -0
  20. data/vendor/sinatra-ditties/lib/sinatra/ditties.rb +12 -0
  21. data/vendor/sinatra-ditties/lib/sinatra/ditties/authorization.rb +61 -0
  22. data/vendor/sinatra-ditties/lib/sinatra/ditties/mailer.rb +146 -0
  23. metadata +79 -318
  24. data/VERSION.yml +0 -4
  25. data/config/config.ru +0 -29
  26. data/config/config.yml +0 -34
  27. data/lib/integrity/notifier/test_helpers.rb +0 -100
  28. data/vendor/webrat/History.txt +0 -306
  29. data/vendor/webrat/MIT-LICENSE.txt +0 -19
  30. data/vendor/webrat/README.rdoc +0 -85
  31. data/vendor/webrat/Rakefile +0 -151
  32. data/vendor/webrat/install.rb +0 -1
  33. data/vendor/webrat/lib/webrat.rb +0 -34
  34. data/vendor/webrat/lib/webrat/core.rb +0 -14
  35. data/vendor/webrat/lib/webrat/core/configuration.rb +0 -98
  36. data/vendor/webrat/lib/webrat/core/elements/area.rb +0 -31
  37. data/vendor/webrat/lib/webrat/core/elements/element.rb +0 -33
  38. data/vendor/webrat/lib/webrat/core/elements/field.rb +0 -403
  39. data/vendor/webrat/lib/webrat/core/elements/form.rb +0 -103
  40. data/vendor/webrat/lib/webrat/core/elements/label.rb +0 -31
  41. data/vendor/webrat/lib/webrat/core/elements/link.rb +0 -90
  42. data/vendor/webrat/lib/webrat/core/elements/select_option.rb +0 -35
  43. data/vendor/webrat/lib/webrat/core/locators.rb +0 -20
  44. data/vendor/webrat/lib/webrat/core/locators/area_locator.rb +0 -38
  45. data/vendor/webrat/lib/webrat/core/locators/button_locator.rb +0 -54
  46. data/vendor/webrat/lib/webrat/core/locators/field_by_id_locator.rb +0 -37
  47. data/vendor/webrat/lib/webrat/core/locators/field_labeled_locator.rb +0 -56
  48. data/vendor/webrat/lib/webrat/core/locators/field_locator.rb +0 -25
  49. data/vendor/webrat/lib/webrat/core/locators/field_named_locator.rb +0 -41
  50. data/vendor/webrat/lib/webrat/core/locators/form_locator.rb +0 -19
  51. data/vendor/webrat/lib/webrat/core/locators/label_locator.rb +0 -34
  52. data/vendor/webrat/lib/webrat/core/locators/link_locator.rb +0 -66
  53. data/vendor/webrat/lib/webrat/core/locators/locator.rb +0 -20
  54. data/vendor/webrat/lib/webrat/core/locators/select_option_locator.rb +0 -59
  55. data/vendor/webrat/lib/webrat/core/logging.rb +0 -21
  56. data/vendor/webrat/lib/webrat/core/matchers.rb +0 -4
  57. data/vendor/webrat/lib/webrat/core/matchers/have_content.rb +0 -73
  58. data/vendor/webrat/lib/webrat/core/matchers/have_selector.rb +0 -74
  59. data/vendor/webrat/lib/webrat/core/matchers/have_tag.rb +0 -21
  60. data/vendor/webrat/lib/webrat/core/matchers/have_xpath.rb +0 -147
  61. data/vendor/webrat/lib/webrat/core/methods.rb +0 -61
  62. data/vendor/webrat/lib/webrat/core/mime.rb +0 -29
  63. data/vendor/webrat/lib/webrat/core/save_and_open_page.rb +0 -50
  64. data/vendor/webrat/lib/webrat/core/scope.rb +0 -350
  65. data/vendor/webrat/lib/webrat/core/session.rb +0 -281
  66. data/vendor/webrat/lib/webrat/core/xml.rb +0 -115
  67. data/vendor/webrat/lib/webrat/core/xml/hpricot.rb +0 -19
  68. data/vendor/webrat/lib/webrat/core/xml/nokogiri.rb +0 -76
  69. data/vendor/webrat/lib/webrat/core/xml/rexml.rb +0 -24
  70. data/vendor/webrat/lib/webrat/core_extensions/blank.rb +0 -58
  71. data/vendor/webrat/lib/webrat/core_extensions/deprecate.rb +0 -8
  72. data/vendor/webrat/lib/webrat/core_extensions/detect_mapped.rb +0 -12
  73. data/vendor/webrat/lib/webrat/core_extensions/meta_class.rb +0 -6
  74. data/vendor/webrat/lib/webrat/core_extensions/nil_to_param.rb +0 -5
  75. data/vendor/webrat/lib/webrat/mechanize.rb +0 -74
  76. data/vendor/webrat/lib/webrat/merb.rb +0 -9
  77. data/vendor/webrat/lib/webrat/merb_session.rb +0 -65
  78. data/vendor/webrat/lib/webrat/rack.rb +0 -24
  79. data/vendor/webrat/lib/webrat/rails.rb +0 -105
  80. data/vendor/webrat/lib/webrat/rspec-rails.rb +0 -13
  81. data/vendor/webrat/lib/webrat/selenium.rb +0 -154
  82. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js +0 -12
  83. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/label.js +0 -16
  84. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webrat.js +0 -5
  85. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlink.js +0 -9
  86. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +0 -15
  87. data/vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +0 -5
  88. data/vendor/webrat/lib/webrat/selenium/matchers.rb +0 -4
  89. data/vendor/webrat/lib/webrat/selenium/matchers/have_content.rb +0 -66
  90. data/vendor/webrat/lib/webrat/selenium/matchers/have_selector.rb +0 -49
  91. data/vendor/webrat/lib/webrat/selenium/matchers/have_tag.rb +0 -72
  92. data/vendor/webrat/lib/webrat/selenium/matchers/have_xpath.rb +0 -45
  93. data/vendor/webrat/lib/webrat/selenium/selenium_extensions.js +0 -6
  94. data/vendor/webrat/lib/webrat/selenium/selenium_session.rb +0 -247
  95. data/vendor/webrat/lib/webrat/sinatra.rb +0 -44
  96. data/vendor/webrat/spec/fakes/test_session.rb +0 -34
  97. data/vendor/webrat/spec/integration/merb/Rakefile +0 -35
  98. data/vendor/webrat/spec/integration/merb/app/controllers/application.rb +0 -2
  99. data/vendor/webrat/spec/integration/merb/app/controllers/exceptions.rb +0 -13
  100. data/vendor/webrat/spec/integration/merb/app/controllers/testing.rb +0 -18
  101. data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +0 -63
  102. data/vendor/webrat/spec/integration/merb/app/views/exceptions/not_found.html.erb +0 -47
  103. data/vendor/webrat/spec/integration/merb/app/views/layout/application.html.erb +0 -12
  104. data/vendor/webrat/spec/integration/merb/app/views/testing/show_form.html.erb +0 -27
  105. data/vendor/webrat/spec/integration/merb/config/environments/development.rb +0 -15
  106. data/vendor/webrat/spec/integration/merb/config/environments/rake.rb +0 -11
  107. data/vendor/webrat/spec/integration/merb/config/environments/test.rb +0 -14
  108. data/vendor/webrat/spec/integration/merb/config/init.rb +0 -25
  109. data/vendor/webrat/spec/integration/merb/config/rack.rb +0 -11
  110. data/vendor/webrat/spec/integration/merb/config/router.rb +0 -33
  111. data/vendor/webrat/spec/integration/merb/spec/spec.opts +0 -1
  112. data/vendor/webrat/spec/integration/merb/spec/spec_helper.rb +0 -24
  113. data/vendor/webrat/spec/integration/merb/spec/webrat_spec.rb +0 -32
  114. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/app_script.rb +0 -31
  115. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/common.rb +0 -64
  116. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/gem_ext.rb +0 -124
  117. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/main.thor +0 -150
  118. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/ops.rb +0 -93
  119. data/vendor/webrat/spec/integration/merb/tasks/merb.thor/utils.rb +0 -40
  120. data/vendor/webrat/spec/integration/rails/Rakefile +0 -30
  121. data/vendor/webrat/spec/integration/rails/app/controllers/application.rb +0 -15
  122. data/vendor/webrat/spec/integration/rails/app/controllers/webrat_controller.rb +0 -39
  123. data/vendor/webrat/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +0 -4
  124. data/vendor/webrat/spec/integration/rails/app/views/webrat/form.html.erb +0 -28
  125. data/vendor/webrat/spec/integration/rails/config/boot.rb +0 -109
  126. data/vendor/webrat/spec/integration/rails/config/environment.rb +0 -12
  127. data/vendor/webrat/spec/integration/rails/config/environments/development.rb +0 -17
  128. data/vendor/webrat/spec/integration/rails/config/environments/selenium.rb +0 -22
  129. data/vendor/webrat/spec/integration/rails/config/environments/test.rb +0 -22
  130. data/vendor/webrat/spec/integration/rails/config/initializers/inflections.rb +0 -10
  131. data/vendor/webrat/spec/integration/rails/config/initializers/mime_types.rb +0 -5
  132. data/vendor/webrat/spec/integration/rails/config/initializers/new_rails_defaults.rb +0 -17
  133. data/vendor/webrat/spec/integration/rails/config/locales/en.yml +0 -5
  134. data/vendor/webrat/spec/integration/rails/config/routes.rb +0 -14
  135. data/vendor/webrat/spec/integration/rails/public/404.html +0 -30
  136. data/vendor/webrat/spec/integration/rails/public/422.html +0 -30
  137. data/vendor/webrat/spec/integration/rails/public/500.html +0 -33
  138. data/vendor/webrat/spec/integration/rails/script/about +0 -4
  139. data/vendor/webrat/spec/integration/rails/script/console +0 -3
  140. data/vendor/webrat/spec/integration/rails/script/dbconsole +0 -3
  141. data/vendor/webrat/spec/integration/rails/script/destroy +0 -3
  142. data/vendor/webrat/spec/integration/rails/script/generate +0 -3
  143. data/vendor/webrat/spec/integration/rails/script/performance/benchmarker +0 -3
  144. data/vendor/webrat/spec/integration/rails/script/performance/profiler +0 -3
  145. data/vendor/webrat/spec/integration/rails/script/performance/request +0 -3
  146. data/vendor/webrat/spec/integration/rails/script/plugin +0 -3
  147. data/vendor/webrat/spec/integration/rails/script/process/inspector +0 -3
  148. data/vendor/webrat/spec/integration/rails/script/process/reaper +0 -3
  149. data/vendor/webrat/spec/integration/rails/script/process/spawner +0 -3
  150. data/vendor/webrat/spec/integration/rails/script/runner +0 -3
  151. data/vendor/webrat/spec/integration/rails/script/server +0 -3
  152. data/vendor/webrat/spec/integration/rails/test/integration/webrat_test.rb +0 -80
  153. data/vendor/webrat/spec/integration/rails/test/test_helper.rb +0 -25
  154. data/vendor/webrat/spec/integration/sinatra/Rakefile +0 -5
  155. data/vendor/webrat/spec/integration/sinatra/classic_app.rb +0 -64
  156. data/vendor/webrat/spec/integration/sinatra/modular_app.rb +0 -16
  157. data/vendor/webrat/spec/integration/sinatra/test/classic_app_test.rb +0 -37
  158. data/vendor/webrat/spec/integration/sinatra/test/modular_app_test.rb +0 -18
  159. data/vendor/webrat/spec/integration/sinatra/test/test_helper.rb +0 -16
  160. data/vendor/webrat/spec/private/core/configuration_spec.rb +0 -104
  161. data/vendor/webrat/spec/private/core/field_spec.rb +0 -67
  162. data/vendor/webrat/spec/private/core/link_spec.rb +0 -24
  163. data/vendor/webrat/spec/private/core/logging_spec.rb +0 -10
  164. data/vendor/webrat/spec/private/core/session_spec.rb +0 -198
  165. data/vendor/webrat/spec/private/mechanize/mechanize_session_spec.rb +0 -81
  166. data/vendor/webrat/spec/private/merb/merb_session_spec.rb +0 -42
  167. data/vendor/webrat/spec/private/nokogiri_spec.rb +0 -77
  168. data/vendor/webrat/spec/private/rails/attaches_file_spec.rb +0 -81
  169. data/vendor/webrat/spec/private/rails/rails_session_spec.rb +0 -110
  170. data/vendor/webrat/spec/private/selenium/selenium_session_spec.rb +0 -44
  171. data/vendor/webrat/spec/private/selenium/selenium_spec.rb +0 -109
  172. data/vendor/webrat/spec/public/basic_auth_spec.rb +0 -24
  173. data/vendor/webrat/spec/public/check_spec.rb +0 -191
  174. data/vendor/webrat/spec/public/choose_spec.rb +0 -118
  175. data/vendor/webrat/spec/public/click_area_spec.rb +0 -106
  176. data/vendor/webrat/spec/public/click_button_spec.rb +0 -502
  177. data/vendor/webrat/spec/public/click_link_spec.rb +0 -469
  178. data/vendor/webrat/spec/public/fill_in_spec.rb +0 -209
  179. data/vendor/webrat/spec/public/locators/field_by_xpath_spec.rb +0 -19
  180. data/vendor/webrat/spec/public/locators/field_labeled_spec.rb +0 -157
  181. data/vendor/webrat/spec/public/locators/field_with_id_spec.rb +0 -16
  182. data/vendor/webrat/spec/public/matchers/contain_spec.rb +0 -114
  183. data/vendor/webrat/spec/public/matchers/have_selector_spec.rb +0 -135
  184. data/vendor/webrat/spec/public/matchers/have_tag_spec.rb +0 -39
  185. data/vendor/webrat/spec/public/matchers/have_xpath_spec.rb +0 -123
  186. data/vendor/webrat/spec/public/reload_spec.rb +0 -10
  187. data/vendor/webrat/spec/public/save_and_open_spec.rb +0 -51
  188. data/vendor/webrat/spec/public/select_date_spec.rb +0 -88
  189. data/vendor/webrat/spec/public/select_datetime_spec.rb +0 -106
  190. data/vendor/webrat/spec/public/select_spec.rb +0 -246
  191. data/vendor/webrat/spec/public/select_time_spec.rb +0 -79
  192. data/vendor/webrat/spec/public/set_hidden_field_spec.rb +0 -5
  193. data/vendor/webrat/spec/public/submit_form_spec.rb +0 -5
  194. data/vendor/webrat/spec/public/visit_spec.rb +0 -58
  195. data/vendor/webrat/spec/public/within_spec.rb +0 -177
  196. data/vendor/webrat/spec/rcov.opts +0 -1
  197. data/vendor/webrat/spec/spec.opts +0 -2
  198. data/vendor/webrat/spec/spec_helper.rb +0 -50
  199. data/vendor/webrat/vendor/selenium-server.jar +0 -0
@@ -1,19 +0,0 @@
1
- Copyright (c) 2007 Bryan Helmkamp, Seth Fitzsimmons
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
@@ -1,85 +0,0 @@
1
- = Webrat - Ruby Acceptance Testing for Web applications
2
-
3
- - http://gitrdoc.com/brynary/webrat
4
- - http://groups.google.com/group/webrat
5
- - http://webrat.lighthouseapp.com/
6
- - http://github.com/brynary/webrat
7
- - #webrat on Freenode
8
-
9
- == Description
10
-
11
- Webrat lets you quickly write expressive and robust acceptance tests for a Ruby
12
- web application.
13
-
14
- == Features
15
-
16
- * Browser Simulator for expressive, high level acceptance testing without the
17
- performance hit and browser dependency of Selenium or Watir (See Webrat::Session)
18
- * Use the same API for Browser Simulator and real Selenium tests using
19
- Webrat::Selenium when necessary (eg. for testing AJAX interactions)
20
- * Supports multiple Ruby web frameworks: Rails, Merb and Sinatra
21
- * Supports popular test frameworks: RSpec, Cucumber, Test::Unit and Shoulda
22
- * Webrat::Matchers API for verifying rendered HTML using CSS, XPath, etc.
23
-
24
- == Example
25
-
26
- class SignupTest < ActionController::IntegrationTest
27
-
28
- def test_trial_account_sign_up
29
- visit home_path
30
- click_link "Sign up"
31
- fill_in "Email", :with => "good@example.com"
32
- select "Free account"
33
- click_button "Register"
34
- end
35
-
36
- end
37
-
38
- Behind the scenes, Webrat will ensure:
39
-
40
- * If a link, form field or button is missing, the test will fail.
41
- * If a URL is invalid, the test will fail.
42
- * If a page load or form submission is unsuccessful, the test will fail.
43
-
44
- == Installing Nokogiri
45
-
46
- Users of Debian Linux (e.g. Ubuntu) need to run:
47
-
48
- sudo apt-get install libxslt1-dev libxml2-dev.
49
-
50
- Otherwise the Nokogiri gem, which Webrat depends on, won't install properly.
51
-
52
- == Install for Rails
53
-
54
- To install the latest release as a gem:
55
-
56
- sudo gem install webrat
57
-
58
- To install the latest code as a plugin: (_Note:_ This may be less stable than using a released version)
59
-
60
- script/plugin install git://github.com/brynary/webrat.git
61
-
62
- In your test_helper.rb or env.rb (for Cucumber) add:
63
-
64
- require "webrat"
65
-
66
- Webrat.configure do |config|
67
- config.mode = :rails
68
- end
69
-
70
- == Install with Merb
71
-
72
- Merb 1.0 has built-in, seamless Webrat support. Just start using
73
- methods from Webrat::Session in your specs.
74
-
75
- == Authors
76
-
77
- - Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
78
- - Original code written by {Seth Fitzsimmons}[mailto:seth@mojodna.net]
79
- - Initial development was sponsored by EastMedia[http://www.eastmedia.com]
80
- - Many other contributors. See attributions in History.txt
81
-
82
- == License
83
-
84
- Copyright (c) 2007-2008 Bryan Helmkamp, Seth Fitzsimmons.
85
- See MIT-LICENSE.txt in this directory.
@@ -1,151 +0,0 @@
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')
9
-
10
- ##############################################################################
11
- # Package && release
12
- ##############################################################################
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"
18
- s.email = "bryan" + "@" + "brynary.com"
19
- s.homepage = "http://github.com/brynary/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"]
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 tntegration tests failed" unless result
144
- end
145
- end
146
- end
147
- end
148
-
149
- task :default => :spec
150
-
151
- task :precommit => ["spec", "spec:jruby", "spec:integration"]
@@ -1 +0,0 @@
1
- puts IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
@@ -1,34 +0,0 @@
1
- require "rubygems"
2
-
3
- $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
4
-
5
- module Webrat
6
- # The common base class for all exceptions raised by Webrat.
7
- class WebratError < StandardError
8
- end
9
-
10
- VERSION = '0.4.2'
11
-
12
- def self.require_xml
13
- gem "nokogiri", ">= 1.0.6"
14
-
15
- if on_java?
16
- # We need Nokogiri's CSS to XPath support, even if using REXML and Hpricot for parsing and searching
17
- require "nokogiri/css"
18
- require "hpricot"
19
- require "rexml/document"
20
- else
21
- require "nokogiri"
22
- require "webrat/core/xml/nokogiri"
23
- end
24
- end
25
-
26
- def self.on_java?
27
- RUBY_PLATFORM =~ /java/
28
- end
29
-
30
- end
31
-
32
- Webrat.require_xml
33
-
34
- require "webrat/core"
@@ -1,14 +0,0 @@
1
- require "webrat/core/configuration"
2
- require "webrat/core/xml"
3
- require "webrat/core/xml/nokogiri"
4
- require "webrat/core/logging"
5
- require "webrat/core/elements/form"
6
- require "webrat/core/scope"
7
- require "webrat/core/elements/link"
8
- require "webrat/core/elements/area"
9
- require "webrat/core/elements/label"
10
- require "webrat/core/elements/select_option"
11
- require "webrat/core/session"
12
- require "webrat/core/methods"
13
- require "webrat/core/matchers"
14
- require "webrat/core/save_and_open_page"
@@ -1,98 +0,0 @@
1
- require "webrat/core_extensions/deprecate"
2
-
3
- module Webrat
4
-
5
- # Configures Webrat. If this is not done, Webrat will be created
6
- # with all of the default settings.
7
- def self.configure(configuration = Webrat.configuration)
8
- yield configuration if block_given?
9
- @@configuration = configuration
10
- end
11
-
12
- def self.configuration # :nodoc:
13
- @@configuration ||= Webrat::Configuration.new
14
- end
15
-
16
- # Webrat can be configured using the Webrat.configure method. For example:
17
- #
18
- # Webrat.configure do |config|
19
- # config.parse_with_nokogiri = false
20
- # end
21
- class Configuration
22
-
23
- # Should XHTML be parsed with Nokogiri? Defaults to true, except on JRuby. When false, Hpricot and REXML are used
24
- attr_writer :parse_with_nokogiri
25
-
26
- # Webrat's mode, set automatically when requiring webrat/rails, webrat/merb, etc.
27
- attr_reader :mode # :nodoc:
28
-
29
- # Save and open pages with error status codes (500-599) in a browser? Defualts to true.
30
- attr_writer :open_error_files
31
-
32
- # Which rails environment should the selenium tests be run in? Defaults to selenium.
33
- attr_accessor :application_environment
34
- webrat_deprecate :selenium_environment, :application_environment
35
- webrat_deprecate :selenium_environment=, :application_environment=
36
-
37
- # Which port is the application running on for selenium testing? Defaults to 3001.
38
- attr_accessor :application_port
39
- webrat_deprecate :selenium_port, :application_port
40
- webrat_deprecate :selenium_port=, :application_port=
41
-
42
- # Which underlying app framework we're testing with selenium
43
- attr_accessor :application_framework
44
-
45
- # Which server the application is running on for selenium testing? Defaults to localhost
46
- attr_accessor :application_address
47
-
48
- # Which server Selenium server is running on. Defaults to nil(server starts in webrat process and runs locally)
49
- attr_accessor :selenium_server_address
50
-
51
- # Which server Selenium port is running on. Defaults to 4444
52
- attr_accessor :selenium_server_port
53
-
54
- # Set the key that Selenium uses to determine the browser running. Default *firefox
55
- attr_accessor :selenium_browser_key
56
-
57
- # How many redirects to the same URL should be halted as an infinite redirect
58
- # loop? Defaults to 10
59
- attr_accessor :infinite_redirect_limit
60
-
61
- def initialize # :nodoc:
62
- self.open_error_files = true
63
- self.parse_with_nokogiri = !Webrat.on_java?
64
- self.application_environment = :selenium
65
- self.application_port = 3001
66
- self.application_address = 'localhost'
67
- self.application_framework = 'rails'
68
- self.selenium_server_port = 4444
69
- self.infinite_redirect_limit = 10
70
- self.selenium_browser_key = '*firefox'
71
- end
72
-
73
- def parse_with_nokogiri? #:nodoc:
74
- @parse_with_nokogiri ? true : false
75
- end
76
-
77
- def open_error_files? #:nodoc:
78
- @open_error_files ? true : false
79
- end
80
-
81
- # Allows setting of webrat's mode, valid modes are:
82
- # :rails, :selenium, :rack, :sinatra, :mechanize, :merb
83
- def mode=(mode)
84
- @mode = mode.to_sym
85
-
86
- # This is a temporary hack to support backwards compatibility
87
- # with Merb 1.0.8 until it's updated to use the new Webrat.configure
88
- # syntax
89
- if @mode == :merb
90
- require("webrat/merb_session")
91
- else
92
- require("webrat/#{mode}")
93
- end
94
- end
95
-
96
- end
97
-
98
- end
@@ -1,31 +0,0 @@
1
- require "webrat/core/elements/element"
2
-
3
- module Webrat
4
- class Area < Element #:nodoc:
5
-
6
- def self.xpath_search
7
- ".//area"
8
- end
9
-
10
- def click(method = nil, options = {})
11
- @session.request_page(absolute_href, :get, {})
12
- end
13
-
14
- protected
15
-
16
- def href
17
- Webrat::XML.attribute(@element, "href")
18
- end
19
-
20
- def absolute_href
21
- if href =~ /^\?/
22
- "#{@session.current_url}#{href}"
23
- elsif href !~ %r{^https?://[\w|.]+(/.*)} && (href !~ /^\//)
24
- "#{@session.current_url}/#{href}"
25
- else
26
- href
27
- end
28
- end
29
-
30
- end
31
- end
@@ -1,33 +0,0 @@
1
- module Webrat
2
-
3
- class Element # :nodoc:
4
-
5
- def self.load_all(session, dom)
6
- Webrat::XML.xpath_search(dom, xpath_search).map do |element|
7
- load(session, element)
8
- end
9
- end
10
-
11
- def self.load(session, element)
12
- return nil if element.nil?
13
- session.elements[Webrat::XML.xpath_to(element)] ||= self.new(session, element)
14
- end
15
-
16
- attr_reader :element
17
-
18
- def initialize(session, element)
19
- @session = session
20
- @element = element
21
- end
22
-
23
- def path
24
- Webrat::XML.xpath_to(@element)
25
- end
26
-
27
- def inspect
28
- "#<#{self.class} @element=#{element.inspect}>"
29
- end
30
-
31
- end
32
-
33
- end