brynary-webrat 0.3.2.2 → 0.4.0

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.
@@ -2,20 +2,28 @@ require 'webrat/rack'
2
2
  require 'sinatra'
3
3
  require 'sinatra/test/methods'
4
4
 
5
+ class Sinatra::Application
6
+ # Override this to prevent Sinatra from barfing on the options passed from RSpec
7
+ def self.load_default_options_from_command_line!
8
+ end
9
+ end
10
+
11
+ disable :run
12
+ disable :reload
13
+
5
14
  module Webrat
6
15
  class SinatraSession < RackSession #:nodoc:
7
16
  include Sinatra::Test::Methods
8
17
 
18
+ attr_reader :request, :response
19
+
9
20
  %w(get head post put delete).each do |verb|
10
21
  define_method(verb) do |*args| # (path, data, headers = nil)
11
22
  path, data, headers = *args
12
- params = data.merge({:env => headers || {}})
23
+ data = data.inject({}) {|data, (key,value)| data[key] = Rack::Utils.unescape(value); data }
24
+ params = data.merge(:env => headers || {})
13
25
  self.__send__("#{verb}_it", path, params)
14
- follow! while @response.redirect?
15
26
  end
16
27
  end
17
-
18
28
  end
19
29
  end
20
-
21
- Webrat.configuration.mode = :sinatra
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brynary-webrat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-25 00:00:00 -08:00
12
+ date: 2009-01-18 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.0.6
22
+ version: 1.1.0
23
23
  version:
24
24
  description: Webrat. Ruby Acceptance Testing for Web applications
25
25
  email: bryan@brynary.com
@@ -87,9 +87,8 @@ files:
87
87
  - lib/webrat/core_extensions/nil_to_param.rb
88
88
  - lib/webrat/mechanize.rb
89
89
  - lib/webrat/merb.rb
90
+ - lib/webrat/merb_session.rb
90
91
  - lib/webrat/rack.rb
91
- - lib/webrat/rails
92
- - lib/webrat/rails/redirect_actions.rb
93
92
  - lib/webrat/rails.rb
94
93
  - lib/webrat/rspec-rails.rb
95
94
  - lib/webrat/selenium
@@ -1,18 +0,0 @@
1
- # For Rails before http://dev.rubyonrails.org/ticket/10497 was committed
2
- module Webrat
3
- module RedirectActions #:nodoc:
4
-
5
- def put_via_redirect(path, parameters = {}, headers = {})
6
- put path, parameters, headers
7
- follow_redirect! while redirect?
8
- status
9
- end
10
-
11
- def delete_via_redirect(path, parameters = {}, headers = {})
12
- delete path, parameters, headers
13
- follow_redirect! while redirect?
14
- status
15
- end
16
-
17
- end
18
- end