capybara 2.10.1 → 2.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07946b3e00d76327b735257b253d81a77f0bfd00
4
- data.tar.gz: d374024318381ec84383a452871be665f7645168
3
+ metadata.gz: 21fdd89225cd5ecf58f6e1eb72da29832f70ba9a
4
+ data.tar.gz: edada38839bc4b98461a27b02f196ec2e2e58ac7
5
5
  SHA512:
6
- metadata.gz: 0d5d700c0b6473d31e6196ff3def9f259a72038c4bfc4082e2b2351bda87ecbe20d25843d59eaba8f6b50de19f0314e708d9e340149cf0385eb2e8c0874f2bfc
7
- data.tar.gz: 5ce06798a097f56b478b3d1d9345aa50bc21977db980832747dba6429edd9506ea20aecbaebd320aae9e17675c46201f168bbdbc34ddf9cc3923e3458eef6184
6
+ metadata.gz: 4f2ed74c7e278e93c5dcf3f92ab35b51a2b31578bff67e25c83076f65ab8e7edd50a2b63afd41ddd65e0a7bc438e6d27adcaae17fcafad6f0e4cd52b241e5797
7
+ data.tar.gz: a97567024d5a9d18858e8b4b1b9920819a6655708f87206ad5c281de9bb39cb5e2185dd1f710618e745483c925ba6e09bbba143d17f7ded222c80acab7be9ce2
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ #2.10.2
2
+ Release date: 2016-11-30
3
+
4
+ ### Fixed
5
+ * App exceptions with multiple parameter initializers now re-raised correctly - Issue #1785 [Michael Lutsiuk]
6
+ * Use Addressable::URI when parsing current_path since it's more lenient of technically invalid URLs - Issue #1801 [Marcos Duque, Thomas Walpole]
7
+
1
8
  #2.10.1
2
9
  Release date: 2016-10-08
3
10
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require 'capybara/session/matchers'
3
+ require 'addressable/uri'
3
4
 
4
5
  module Capybara
5
6
 
@@ -125,7 +126,8 @@ module Capybara
125
126
  begin
126
127
  raise CapybaraError, "Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true"
127
128
  rescue CapybaraError
128
- raise @server.error.class, @server.error.message, @server.error.backtrace
129
+ #needed to get the cause set correctly in JRuby -- otherwise we could just do raise @server.error
130
+ raise @server.error, @server.error.message, @server.error.backtrace
129
131
  end
130
132
  end
131
133
  ensure
@@ -167,7 +169,11 @@ module Capybara
167
169
  # @return [String] Path of the current page, without any domain information
168
170
  #
169
171
  def current_path
170
- path = URI.parse(current_url).path
172
+ # Addressable parsing is more lenient than URI
173
+ uri = Addressable::URI.parse(current_url)
174
+ # Addressable doesn't support opaque URIs - we want nil here
175
+ return nil if uri.scheme == "about"
176
+ path = uri.path
171
177
  path if path and not path.empty?
172
178
  end
173
179
 
@@ -428,6 +428,17 @@ Capybara::SpecHelper.spec "node" do
428
428
  expect(e.cause.message).to match /Your application server raised an error/
429
429
  end
430
430
  end
431
+
432
+ it "sets an explanatory exception as the cause of server exceptions with errors with initializers", requires: [:server, :js], twtw: true do
433
+ skip "This version of ruby doesn't support exception causes" unless Exception.instance_methods.include? :cause
434
+ quietly { @session.visit("/other_error") }
435
+ expect do
436
+ @session.find(:css, 'span')
437
+ end.to raise_error(TestApp::TestAppOtherError) do |e|
438
+ expect(e.cause).to be_a Capybara::CapybaraError
439
+ expect(e.cause.message).to match /Your application server raised an error/
440
+ end
441
+ end
431
442
  end
432
443
 
433
444
  def be_an_invalid_element_error(session)
@@ -6,7 +6,12 @@ require 'yaml'
6
6
 
7
7
  class TestApp < Sinatra::Base
8
8
  class TestAppError < StandardError; end
9
-
9
+ class TestAppOtherError < StandardError
10
+ def initialize(string1, msg)
11
+ @something = string1
12
+ @message = msg
13
+ end
14
+ end
10
15
  set :root, File.dirname(__FILE__)
11
16
  set :static, true
12
17
  set :raise_errors, true
@@ -125,6 +130,10 @@ class TestApp < Sinatra::Base
125
130
  raise TestAppError, "some error"
126
131
  end
127
132
 
133
+ get '/other_error' do
134
+ raise TestAppOtherError.new("something", "other error")
135
+ end
136
+
128
137
  get '/load_error' do
129
138
  raise LoadError
130
139
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Capybara
3
- VERSION = '2.10.1'
3
+ VERSION = '2.10.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.1
4
+ version: 2.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Walpole
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - gem-public_cert.pem
13
- date: 2016-10-08 00:00:00.000000000 Z
13
+ date: 2016-11-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -422,7 +422,7 @@ files:
422
422
  - spec/server_spec.rb
423
423
  - spec/shared_selenium_session.rb
424
424
  - spec/spec_helper.rb
425
- homepage: https://github.com/jnicklas/capybara
425
+ homepage: https://github.com/teamcapybara/capybara
426
426
  licenses:
427
427
  - MIT
428
428
  metadata: {}
@@ -442,7 +442,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
442
442
  version: '0'
443
443
  requirements: []
444
444
  rubyforge_project:
445
- rubygems_version: 2.5.1
445
+ rubygems_version: 2.5.2
446
446
  signing_key:
447
447
  specification_version: 4
448
448
  summary: Capybara aims to simplify the process of integration testing Rack applications,