capybara 3.0.0 → 3.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8389b150e2b44270ed1d94b8f6e0f48af613f1a2f28b8ad772e35cb7db635ad7
4
- data.tar.gz: bace2657813bc0681e4586ba2c96a66e824e12651f0e839a8649ed491f0eafa1
3
+ metadata.gz: e6f9f0b3e74df6a318719eb9ad775a72fbe2f4243218bb74e159ce4cc1a08e45
4
+ data.tar.gz: 72015cfed2914cb5d771bfcfe79c4efada7f19a1c5a3fe4c906404a99377b759
5
5
  SHA512:
6
- metadata.gz: 5ffed0a0be90e5d8bf022b48d261aa160646562095114ca383a446431ab57403d67a6ccf252129a477484a6ea1bdc1edfefa6930571961e6307b5ce180c6aa30
7
- data.tar.gz: e5956efba3a7e4a6833a9b63e61c6f136a3210eb77ac44d8b1603b81b6e5bea7bde1ea3fd4c76b8eda6a10f61c1e0e805aef7f8aa4bcf801061c46a7fded1c02
6
+ metadata.gz: 98d13268dbcd015ba6f4f38dc6a5d2dbb624fd12b593dc78969eedd56f8a9ab621911818b2ddeaf9d82e13e2a0d40edae34b8de84e1c7fcb7f7c01e7442432ea
7
+ data.tar.gz: eae1ee3569660c0e34a92154f422d2f1a777767439f3602a9eb827d00b09cdfb60a78e8a91472edee5b78adbd727cccc1c5eaa37c31badd9e56063a7e5eb6c5b
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ # Version 3.0.1
2
+ Release date: 2018-04-06
3
+
4
+ ### Changed
5
+
6
+ * Restored ability for `Capybara.server=` to accept a proc which was accidentally removed in 3.0.0
7
+
1
8
  # Version 3.0.0
2
9
  Release date: 2018-04-05
3
10
 
@@ -16,7 +23,7 @@ Release date: 2018-03-23
16
23
 
17
24
  ### Changed
18
25
 
19
- * Drivers are now expected to return visible text more in line with the WebDriver spec for visible text
26
+ * Visibile text whitespace is no longer fully normalized in favor of being more in line with the WebDriver spec for visible text
20
27
  * Drivers are expected to close extra windows when resetting the session
21
28
  * Selenium driver supports Date/Time when filling in date/time/datetime-local inputs
22
29
  * `current_url` returns the url for the top level browsing context
@@ -438,7 +438,11 @@ Capybara.register_server :webrick do |app, port, host, **options|
438
438
  end
439
439
 
440
440
  Capybara.register_server :puma do |app, port, host, **options|
441
- require 'rack/handler/puma'
441
+ begin
442
+ require 'rack/handler/puma'
443
+ rescue LoadError
444
+ raise LoadError, "Capybara is unable to load `puma` for its server, please add `puma` to your project or specify a different server via something like `Capybara.server = :webrick`."
445
+ end
442
446
  # If we just run the Puma Rack handler it installs signal handlers which prevent us from being able to interrupt tests.
443
447
  # Therefore construct and run the Server instance ourselves.
444
448
  # Rack::Handler::Puma.run(app, { Host: host, Port: port, Threads: "0:4", workers: 0, daemon: false }.merge(options))
@@ -53,7 +53,9 @@ module Capybara
53
53
  #
54
54
  def server=(name)
55
55
  name, options = *name if name.is_a? Array
56
- @server = if options
56
+ @server = if name.respond_to? :call
57
+ name
58
+ elsif options
57
59
  proc { |app, port, host| Capybara.servers[name.to_sym].call(app, port, host, options) }
58
60
  else
59
61
  Capybara.servers[name.to_sym]
@@ -622,10 +622,6 @@ module Capybara
622
622
  # Checks if the page or current node has the given text content,
623
623
  # ignoring any HTML tags.
624
624
  #
625
- # Whitespaces are normalized in both node's text and passed text parameter.
626
- # Note that whitespace isn't normalized in passed regexp as normalizing whitespace
627
- # in regexp isn't easy and doesn't seem to be worth it.
628
- #
629
625
  # By default it will check if the text occurs at least once,
630
626
  # but a different number can be specified.
631
627
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Capybara
4
- VERSION = '3.0.0'.freeze
4
+ VERSION = '3.0.1'.freeze
5
5
  end
@@ -64,6 +64,18 @@ RSpec.describe Capybara do
64
64
  end
65
65
  end
66
66
 
67
+ describe "server=" do
68
+ after do
69
+ Capybara.server = :default
70
+ end
71
+
72
+ it "accepts a proc" do
73
+ server = ->(_app, _port) {}
74
+ Capybara.server = server
75
+ expect(Capybara.server).to eq server
76
+ end
77
+ end
78
+
67
79
  describe 'app_host' do
68
80
  after do
69
81
  Capybara.app_host = nil
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: 3.0.0
4
+ version: 3.0.1
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: 2018-04-05 00:00:00.000000000 Z
13
+ date: 2018-04-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable