casebook-webrat 0.4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +332 -0
- data/MIT-LICENSE.txt +19 -0
- data/README.rdoc +85 -0
- data/Rakefile +156 -0
- data/install.rb +1 -0
- data/lib/webrat.rb +34 -0
- data/lib/webrat/core.rb +14 -0
- data/lib/webrat/core/configuration.rb +104 -0
- data/lib/webrat/core/elements/area.rb +31 -0
- data/lib/webrat/core/elements/element.rb +33 -0
- data/lib/webrat/core/elements/field.rb +403 -0
- data/lib/webrat/core/elements/form.rb +103 -0
- data/lib/webrat/core/elements/label.rb +31 -0
- data/lib/webrat/core/elements/link.rb +92 -0
- data/lib/webrat/core/elements/select_option.rb +35 -0
- data/lib/webrat/core/locators.rb +20 -0
- data/lib/webrat/core/locators/area_locator.rb +38 -0
- data/lib/webrat/core/locators/button_locator.rb +54 -0
- data/lib/webrat/core/locators/field_by_id_locator.rb +37 -0
- data/lib/webrat/core/locators/field_labeled_locator.rb +56 -0
- data/lib/webrat/core/locators/field_locator.rb +25 -0
- data/lib/webrat/core/locators/field_named_locator.rb +41 -0
- data/lib/webrat/core/locators/form_locator.rb +19 -0
- data/lib/webrat/core/locators/label_locator.rb +34 -0
- data/lib/webrat/core/locators/link_locator.rb +66 -0
- data/lib/webrat/core/locators/locator.rb +20 -0
- data/lib/webrat/core/locators/select_option_locator.rb +59 -0
- data/lib/webrat/core/logging.rb +21 -0
- data/lib/webrat/core/matchers.rb +4 -0
- data/lib/webrat/core/matchers/have_content.rb +73 -0
- data/lib/webrat/core/matchers/have_selector.rb +74 -0
- data/lib/webrat/core/matchers/have_tag.rb +21 -0
- data/lib/webrat/core/matchers/have_xpath.rb +147 -0
- data/lib/webrat/core/methods.rb +61 -0
- data/lib/webrat/core/mime.rb +29 -0
- data/lib/webrat/core/save_and_open_page.rb +50 -0
- data/lib/webrat/core/scope.rb +350 -0
- data/lib/webrat/core/session.rb +281 -0
- data/lib/webrat/core/xml.rb +115 -0
- data/lib/webrat/core/xml/hpricot.rb +19 -0
- data/lib/webrat/core/xml/nokogiri.rb +76 -0
- data/lib/webrat/core/xml/rexml.rb +24 -0
- data/lib/webrat/core_extensions/blank.rb +58 -0
- data/lib/webrat/core_extensions/deprecate.rb +8 -0
- data/lib/webrat/core_extensions/detect_mapped.rb +12 -0
- data/lib/webrat/core_extensions/meta_class.rb +6 -0
- data/lib/webrat/core_extensions/nil_to_param.rb +5 -0
- data/lib/webrat/core_extensions/tcp_socket.rb +27 -0
- data/lib/webrat/mechanize.rb +74 -0
- data/lib/webrat/merb.rb +9 -0
- data/lib/webrat/merb_session.rb +65 -0
- data/lib/webrat/rack.rb +24 -0
- data/lib/webrat/rails.rb +105 -0
- data/lib/webrat/rspec-rails.rb +13 -0
- data/lib/webrat/selenium.rb +80 -0
- data/lib/webrat/selenium/application_server.rb +71 -0
- data/lib/webrat/selenium/location_strategy_javascript/button.js +12 -0
- data/lib/webrat/selenium/location_strategy_javascript/label.js +16 -0
- data/lib/webrat/selenium/location_strategy_javascript/webrat.js +5 -0
- data/lib/webrat/selenium/location_strategy_javascript/webratlink.js +9 -0
- data/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +15 -0
- data/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +5 -0
- data/lib/webrat/selenium/matchers.rb +4 -0
- data/lib/webrat/selenium/matchers/have_content.rb +66 -0
- data/lib/webrat/selenium/matchers/have_selector.rb +49 -0
- data/lib/webrat/selenium/matchers/have_tag.rb +72 -0
- data/lib/webrat/selenium/matchers/have_xpath.rb +45 -0
- data/lib/webrat/selenium/merb_application_server.rb +48 -0
- data/lib/webrat/selenium/rails_application_server.rb +42 -0
- data/lib/webrat/selenium/selenium_extensions.js +6 -0
- data/lib/webrat/selenium/selenium_rc_server.rb +81 -0
- data/lib/webrat/selenium/selenium_session.rb +241 -0
- data/lib/webrat/selenium/sinatra_application_server.rb +35 -0
- data/lib/webrat/sinatra.rb +44 -0
- data/vendor/selenium-server.jar +0 -0
- metadata +147 -0
| @@ -0,0 +1,44 @@ | |
| 1 | 
            +
            require "webrat/rack"
         | 
| 2 | 
            +
            require "sinatra/test"
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            module Webrat
         | 
| 5 | 
            +
              class SinatraSession < RackSession
         | 
| 6 | 
            +
                include Sinatra::Test
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                attr_reader :request, :response
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                def initialize(context = nil)
         | 
| 11 | 
            +
                  super(context)
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  app = context.respond_to?(:app) ? context.app : Sinatra::Application
         | 
| 14 | 
            +
                  @browser = Sinatra::TestHarness.new(app)
         | 
| 15 | 
            +
                end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                %w(get head post put delete).each do |verb|
         | 
| 18 | 
            +
                  class_eval <<-RUBY
         | 
| 19 | 
            +
                    def #{verb}(path, data, headers = {})
         | 
| 20 | 
            +
                      params = data.inject({}) do |data, (key,value)|
         | 
| 21 | 
            +
                        data[key] = Rack::Utils.unescape(value)
         | 
| 22 | 
            +
                        data
         | 
| 23 | 
            +
                      end
         | 
| 24 | 
            +
                      headers["HTTP_HOST"] = "www.example.com"
         | 
| 25 | 
            +
                      @browser.#{verb}(path, params, headers)
         | 
| 26 | 
            +
                    end
         | 
| 27 | 
            +
                  RUBY
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                def response_body
         | 
| 31 | 
            +
                  @browser.body
         | 
| 32 | 
            +
                end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                def response_code
         | 
| 35 | 
            +
                  @browser.status
         | 
| 36 | 
            +
                end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                private
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                  def response
         | 
| 41 | 
            +
                    @browser.response
         | 
| 42 | 
            +
                  end
         | 
| 43 | 
            +
              end
         | 
| 44 | 
            +
            end
         | 
| Binary file | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,147 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification 
         | 
| 2 | 
            +
            name: casebook-webrat
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            +
              version: 0.4.4.1
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors: 
         | 
| 7 | 
            +
            - Bryan Helmkamp
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            date: 2009-04-14 00:00:00 -07:00
         | 
| 13 | 
            +
            default_executable: 
         | 
| 14 | 
            +
            dependencies: 
         | 
| 15 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 16 | 
            +
              name: nokogiri
         | 
| 17 | 
            +
              type: :runtime
         | 
| 18 | 
            +
              version_requirement: 
         | 
| 19 | 
            +
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 20 | 
            +
                requirements: 
         | 
| 21 | 
            +
                - - ">="
         | 
| 22 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 23 | 
            +
                    version: 1.2.0
         | 
| 24 | 
            +
                version: 
         | 
| 25 | 
            +
            description: Webrat. Ruby Acceptance Testing for Web applications
         | 
| 26 | 
            +
            email: bryan@brynary.com
         | 
| 27 | 
            +
            executables: []
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            extensions: []
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            extra_rdoc_files: 
         | 
| 32 | 
            +
            - README.rdoc
         | 
| 33 | 
            +
            - MIT-LICENSE.txt
         | 
| 34 | 
            +
            files: 
         | 
| 35 | 
            +
            - History.txt
         | 
| 36 | 
            +
            - install.rb
         | 
| 37 | 
            +
            - MIT-LICENSE.txt
         | 
| 38 | 
            +
            - README.rdoc
         | 
| 39 | 
            +
            - Rakefile
         | 
| 40 | 
            +
            - lib/webrat
         | 
| 41 | 
            +
            - lib/webrat/core
         | 
| 42 | 
            +
            - lib/webrat/core/configuration.rb
         | 
| 43 | 
            +
            - lib/webrat/core/elements
         | 
| 44 | 
            +
            - lib/webrat/core/elements/area.rb
         | 
| 45 | 
            +
            - lib/webrat/core/elements/element.rb
         | 
| 46 | 
            +
            - lib/webrat/core/elements/field.rb
         | 
| 47 | 
            +
            - lib/webrat/core/elements/form.rb
         | 
| 48 | 
            +
            - lib/webrat/core/elements/label.rb
         | 
| 49 | 
            +
            - lib/webrat/core/elements/link.rb
         | 
| 50 | 
            +
            - lib/webrat/core/elements/select_option.rb
         | 
| 51 | 
            +
            - lib/webrat/core/locators
         | 
| 52 | 
            +
            - lib/webrat/core/locators/area_locator.rb
         | 
| 53 | 
            +
            - lib/webrat/core/locators/button_locator.rb
         | 
| 54 | 
            +
            - lib/webrat/core/locators/field_by_id_locator.rb
         | 
| 55 | 
            +
            - lib/webrat/core/locators/field_labeled_locator.rb
         | 
| 56 | 
            +
            - lib/webrat/core/locators/field_locator.rb
         | 
| 57 | 
            +
            - lib/webrat/core/locators/field_named_locator.rb
         | 
| 58 | 
            +
            - lib/webrat/core/locators/form_locator.rb
         | 
| 59 | 
            +
            - lib/webrat/core/locators/label_locator.rb
         | 
| 60 | 
            +
            - lib/webrat/core/locators/link_locator.rb
         | 
| 61 | 
            +
            - lib/webrat/core/locators/locator.rb
         | 
| 62 | 
            +
            - lib/webrat/core/locators/select_option_locator.rb
         | 
| 63 | 
            +
            - lib/webrat/core/locators.rb
         | 
| 64 | 
            +
            - lib/webrat/core/logging.rb
         | 
| 65 | 
            +
            - lib/webrat/core/matchers
         | 
| 66 | 
            +
            - lib/webrat/core/matchers/have_content.rb
         | 
| 67 | 
            +
            - lib/webrat/core/matchers/have_selector.rb
         | 
| 68 | 
            +
            - lib/webrat/core/matchers/have_tag.rb
         | 
| 69 | 
            +
            - lib/webrat/core/matchers/have_xpath.rb
         | 
| 70 | 
            +
            - lib/webrat/core/matchers.rb
         | 
| 71 | 
            +
            - lib/webrat/core/methods.rb
         | 
| 72 | 
            +
            - lib/webrat/core/mime.rb
         | 
| 73 | 
            +
            - lib/webrat/core/save_and_open_page.rb
         | 
| 74 | 
            +
            - lib/webrat/core/scope.rb
         | 
| 75 | 
            +
            - lib/webrat/core/session.rb
         | 
| 76 | 
            +
            - lib/webrat/core/xml
         | 
| 77 | 
            +
            - lib/webrat/core/xml/hpricot.rb
         | 
| 78 | 
            +
            - lib/webrat/core/xml/nokogiri.rb
         | 
| 79 | 
            +
            - lib/webrat/core/xml/rexml.rb
         | 
| 80 | 
            +
            - lib/webrat/core/xml.rb
         | 
| 81 | 
            +
            - lib/webrat/core.rb
         | 
| 82 | 
            +
            - lib/webrat/core_extensions
         | 
| 83 | 
            +
            - lib/webrat/core_extensions/blank.rb
         | 
| 84 | 
            +
            - lib/webrat/core_extensions/deprecate.rb
         | 
| 85 | 
            +
            - lib/webrat/core_extensions/detect_mapped.rb
         | 
| 86 | 
            +
            - lib/webrat/core_extensions/meta_class.rb
         | 
| 87 | 
            +
            - lib/webrat/core_extensions/nil_to_param.rb
         | 
| 88 | 
            +
            - lib/webrat/core_extensions/tcp_socket.rb
         | 
| 89 | 
            +
            - lib/webrat/mechanize.rb
         | 
| 90 | 
            +
            - lib/webrat/merb.rb
         | 
| 91 | 
            +
            - lib/webrat/merb_session.rb
         | 
| 92 | 
            +
            - lib/webrat/rack.rb
         | 
| 93 | 
            +
            - lib/webrat/rails.rb
         | 
| 94 | 
            +
            - lib/webrat/rspec-rails.rb
         | 
| 95 | 
            +
            - lib/webrat/selenium
         | 
| 96 | 
            +
            - lib/webrat/selenium/application_server.rb
         | 
| 97 | 
            +
            - lib/webrat/selenium/location_strategy_javascript
         | 
| 98 | 
            +
            - lib/webrat/selenium/location_strategy_javascript/button.js
         | 
| 99 | 
            +
            - lib/webrat/selenium/location_strategy_javascript/label.js
         | 
| 100 | 
            +
            - lib/webrat/selenium/location_strategy_javascript/webrat.js
         | 
| 101 | 
            +
            - lib/webrat/selenium/location_strategy_javascript/webratlink.js
         | 
| 102 | 
            +
            - lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js
         | 
| 103 | 
            +
            - lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js
         | 
| 104 | 
            +
            - lib/webrat/selenium/matchers
         | 
| 105 | 
            +
            - lib/webrat/selenium/matchers/have_content.rb
         | 
| 106 | 
            +
            - lib/webrat/selenium/matchers/have_selector.rb
         | 
| 107 | 
            +
            - lib/webrat/selenium/matchers/have_tag.rb
         | 
| 108 | 
            +
            - lib/webrat/selenium/matchers/have_xpath.rb
         | 
| 109 | 
            +
            - lib/webrat/selenium/matchers.rb
         | 
| 110 | 
            +
            - lib/webrat/selenium/merb_application_server.rb
         | 
| 111 | 
            +
            - lib/webrat/selenium/rails_application_server.rb
         | 
| 112 | 
            +
            - lib/webrat/selenium/selenium_extensions.js
         | 
| 113 | 
            +
            - lib/webrat/selenium/selenium_rc_server.rb
         | 
| 114 | 
            +
            - lib/webrat/selenium/selenium_session.rb
         | 
| 115 | 
            +
            - lib/webrat/selenium/sinatra_application_server.rb
         | 
| 116 | 
            +
            - lib/webrat/selenium.rb
         | 
| 117 | 
            +
            - lib/webrat/sinatra.rb
         | 
| 118 | 
            +
            - lib/webrat.rb
         | 
| 119 | 
            +
            - vendor/selenium-server.jar
         | 
| 120 | 
            +
            has_rdoc: true
         | 
| 121 | 
            +
            homepage: http://github.com/brynary/webrat
         | 
| 122 | 
            +
            post_install_message: 
         | 
| 123 | 
            +
            rdoc_options: []
         | 
| 124 | 
            +
             | 
| 125 | 
            +
            require_paths: 
         | 
| 126 | 
            +
            - lib
         | 
| 127 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         | 
| 128 | 
            +
              requirements: 
         | 
| 129 | 
            +
              - - ">="
         | 
| 130 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 131 | 
            +
                  version: "0"
         | 
| 132 | 
            +
              version: 
         | 
| 133 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 134 | 
            +
              requirements: 
         | 
| 135 | 
            +
              - - ">="
         | 
| 136 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 137 | 
            +
                  version: "0"
         | 
| 138 | 
            +
              version: 
         | 
| 139 | 
            +
            requirements: []
         | 
| 140 | 
            +
             | 
| 141 | 
            +
            rubyforge_project: webrat
         | 
| 142 | 
            +
            rubygems_version: 1.2.0
         | 
| 143 | 
            +
            signing_key: 
         | 
| 144 | 
            +
            specification_version: 2
         | 
| 145 | 
            +
            summary: Webrat. Ruby Acceptance Testing for Web applications
         | 
| 146 | 
            +
            test_files: []
         | 
| 147 | 
            +
             |