capybara-json 0.2.4 → 0.3.0.beta1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
+ ## 0.3.0.beta1
2
+ * Capybara 2.x support, but test not working now... (thanks to gkellogg)
3
+
1
4
  ## 0.2.4
2
- * add __FILE__ and __LINE__ to module_eval (@mad_p)
5
+ * Added __FILE__ and __LINE__ so that pry can find generated methods (thanks to @mad_p)
3
6
 
4
7
  ## 0.2.3
5
8
  * ENHANCEMENT
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.3.0.beta1
@@ -82,13 +82,27 @@ class Capybara::HTTPClientJson::Driver < Capybara::Json::Driver::Base
82
82
  }
83
83
  end
84
84
 
85
+ def needs_server?
86
+ true
87
+ end
88
+
85
89
  def reset!
86
90
  @client = nil
87
91
  end
88
92
 
89
93
  protected
90
94
  def process(method, path, params = {}, headers = {}, options = {})
91
- @current_url = @rack_server.url(path)
95
+ @current_url = if @rack_server.respond_to?(:url)
96
+ @rack_server.url(path)
97
+ elsif path !~ /^http/
98
+ if Capybara.app_host
99
+ Capybara.app_host + path.to_s
100
+ else
101
+ "http://#{@rack_server.host}:#{@rack_server.port}" + path.to_s
102
+ end
103
+ else
104
+ path
105
+ end
92
106
 
93
107
  begin
94
108
  @response = client.__send__(method, @current_url, params, headers, options)
@@ -9,5 +9,6 @@ module Capybara::Json::Driver
9
9
  raise NotImplementedError
10
10
  end
11
11
  end
12
+ def needs_server?; false; end
12
13
  end
13
14
  end
data/lib/capybara/json.rb CHANGED
@@ -30,14 +30,6 @@ module Capybara
30
30
  DEF
31
31
  end
32
32
 
33
- %w[ json ].each do |method|
34
- module_eval <<-DEF, __FILE__, __LINE__ + 1
35
- def #{method}
36
- page.driver.#{method}
37
- end
38
- DEF
39
- end
40
-
41
33
  autoload :Error, 'capybara/json/error'
42
34
 
43
35
  module Driver
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
5
- prerelease:
4
+ version: 0.3.0.beta1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - okitan
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-01 00:00:00.000000000 Z
12
+ date: 2012-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
@@ -236,9 +236,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
236
  required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  none: false
238
238
  requirements:
239
- - - ! '>='
239
+ - - ! '>'
240
240
  - !ruby/object:Gem::Version
241
- version: '0'
241
+ version: 1.3.1
242
242
  requirements: []
243
243
  rubyforge_project: capybara-json
244
244
  rubygems_version: 1.8.24