capybara 2.12.0 → 2.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +6 -0
- data/lib/capybara/queries/current_path_query.rb +1 -1
- data/lib/capybara/queries/selector_query.rb +3 -3
- data/lib/capybara/result.rb +6 -6
- data/lib/capybara/selector.rb +3 -3
- data/lib/capybara/session.rb +1 -1
- data/lib/capybara/spec/views/buttons.erb +1 -1
- data/lib/capybara/spec/views/fieldsets.erb +1 -1
- data/lib/capybara/spec/views/form.erb +1 -1
- data/lib/capybara/spec/views/frame_child.erb +1 -1
- data/lib/capybara/spec/views/frame_one.erb +1 -1
- data/lib/capybara/spec/views/frame_parent.erb +1 -1
- data/lib/capybara/spec/views/frame_two.erb +1 -1
- data/lib/capybara/spec/views/header_links.erb +1 -1
- data/lib/capybara/spec/views/host_links.erb +1 -1
- data/lib/capybara/spec/views/path.erb +1 -1
- data/lib/capybara/spec/views/popup_one.erb +1 -1
- data/lib/capybara/spec/views/popup_two.erb +1 -1
- data/lib/capybara/spec/views/postback.erb +1 -1
- data/lib/capybara/spec/views/tables.erb +1 -1
- data/lib/capybara/spec/views/with_base_tag.erb +1 -1
- data/lib/capybara/spec/views/with_count.erb +1 -1
- data/lib/capybara/spec/views/with_hover.erb +1 -1
- data/lib/capybara/spec/views/with_html.erb +1 -1
- data/lib/capybara/spec/views/with_html_entities.erb +1 -1
- data/lib/capybara/spec/views/with_js.erb +1 -1
- data/lib/capybara/spec/views/with_scope.erb +1 -1
- data/lib/capybara/spec/views/with_simple_html.erb +1 -1
- data/lib/capybara/spec/views/with_title.erb +1 -1
- data/lib/capybara/spec/views/with_windows.erb +1 -1
- data/lib/capybara/spec/views/within_frames.erb +1 -1
- data/lib/capybara/version.rb +1 -1
- data/spec/result_spec.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 366aecdcbfc57f6102bd9216645cfdb69dea2f0e
|
4
|
+
data.tar.gz: 989edd37eea1f619de795362350584f25af60b17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccd1760a40ac203ebf7ba2b38104e64e9eea0446ccc596898b8467f5c0471f37e003ca84616c82843426928b6997d7be3b748beb85aa00e34a70573551027427
|
7
|
+
data.tar.gz: 7d51a1a4fc3c405774710bd4eae7d922fa1957d5900f50c68a5f58c70f762d73d11ac00964654c7408320c10c4b401dea588e3eec35f9cc3f13482a42aca1362
|
data/History.md
CHANGED
@@ -29,7 +29,7 @@ module Capybara
|
|
29
29
|
if @expected_path.is_a? Regexp
|
30
30
|
@actual_path.match(@expected_path)
|
31
31
|
else
|
32
|
-
::Addressable::URI.parse(@expected_path) == Addressable::URI.parse(@actual_path)
|
32
|
+
::Addressable::URI.parse(@expected_path) == ::Addressable::URI.parse(@actual_path)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -42,7 +42,7 @@ module Capybara
|
|
42
42
|
|
43
43
|
def description
|
44
44
|
@description = String.new("#{label} #{locator.inspect}")
|
45
|
-
@description << " with#{" exact" if exact_text
|
45
|
+
@description << " with#{" exact" if exact_text == true} text #{options[:text].inspect}" if options[:text]
|
46
46
|
@description << " with exact text #{options[:exact_text]}" if options[:exact_text].is_a?(String)
|
47
47
|
@description << " with id #{options[:id]}" if options[:id]
|
48
48
|
@description << " with classes #{Array(options[:class]).join(',')}]" if options[:class]
|
@@ -56,7 +56,7 @@ module Capybara
|
|
56
56
|
regexp = if options[:text].is_a?(Regexp)
|
57
57
|
options[:text]
|
58
58
|
else
|
59
|
-
if exact_text
|
59
|
+
if exact_text == true
|
60
60
|
"\\A#{Regexp.escape(options[:text].to_s)}\\z"
|
61
61
|
else
|
62
62
|
Regexp.escape(options[:text].to_s)
|
@@ -205,7 +205,7 @@ module Capybara
|
|
205
205
|
end
|
206
206
|
|
207
207
|
def exact_text
|
208
|
-
|
208
|
+
options.fetch(:exact_text, Capybara.exact_text)
|
209
209
|
end
|
210
210
|
end
|
211
211
|
end
|
data/lib/capybara/result.rb
CHANGED
@@ -28,11 +28,6 @@ module Capybara
|
|
28
28
|
@result_cache = []
|
29
29
|
@results_enum = lazy_select_elements { |node| query.matches_filters?(node) }
|
30
30
|
@query = query
|
31
|
-
# JRuby < 9.1.6.0 has an issue with eagerly finding next in lazy enumerators which
|
32
|
-
# causes a concurrency issue with network requests here
|
33
|
-
# https://github.com/jruby/jruby/issues/4212
|
34
|
-
# Just force all the results to be evaluated
|
35
|
-
full_results if RUBY_PLATFORM == 'java' && (Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('9.1.6.0'))
|
36
31
|
end
|
37
32
|
|
38
33
|
def_delegators :full_results, :size, :length, :last, :values_at, :inspect, :sample
|
@@ -138,7 +133,12 @@ module Capybara
|
|
138
133
|
end
|
139
134
|
|
140
135
|
def lazy_select_elements(&block)
|
141
|
-
|
136
|
+
# JRuby has an issue with lazy enumerators which
|
137
|
+
# causes a concurrency issue with network requests here
|
138
|
+
# https://github.com/jruby/jruby/issues/4212
|
139
|
+
if RUBY_PLATFORM == 'java'
|
140
|
+
@elements.select(&block).to_enum # non-lazy evaluation
|
141
|
+
elsif @elements.respond_to? :lazy #Ruby 2.0+
|
142
142
|
@elements.lazy.select(&block)
|
143
143
|
else
|
144
144
|
Enumerator.new do |yielder|
|
data/lib/capybara/selector.rb
CHANGED
@@ -8,12 +8,12 @@ Capybara::Selector::FilterSet.add(:_field) do
|
|
8
8
|
|
9
9
|
describe do |options|
|
10
10
|
desc, states = String.new, []
|
11
|
-
states << 'checked' if options[:checked] || (options[:unchecked]
|
12
|
-
states << 'not checked' if options[:unchecked] || (options[:checked]
|
11
|
+
states << 'checked' if options[:checked] || (options[:unchecked] == false)
|
12
|
+
states << 'not checked' if options[:unchecked] || (options[:checked] == false)
|
13
13
|
states << 'disabled' if options[:disabled] == true
|
14
14
|
desc << " that is #{states.join(' and ')}" unless states.empty?
|
15
15
|
desc << " with the multiple attribute" if options[:multiple] == true
|
16
|
-
desc << " without the multiple attribute" if options[:multiple]
|
16
|
+
desc << " without the multiple attribute" if options[:multiple] == false
|
17
17
|
desc
|
18
18
|
end
|
19
19
|
end
|
data/lib/capybara/session.rb
CHANGED
@@ -172,7 +172,7 @@ module Capybara
|
|
172
172
|
#
|
173
173
|
def current_path
|
174
174
|
# Addressable parsing is more lenient than URI
|
175
|
-
uri = Addressable::URI.parse(current_url)
|
175
|
+
uri = ::Addressable::URI.parse(current_url)
|
176
176
|
|
177
177
|
# If current_url ends up being nil, won't be able to call .path on a NilClass.
|
178
178
|
return nil if uri.nil?
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
|
2
2
|
Encoding with — html entities »
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
|
2
2
|
Bar
|
data/lib/capybara/version.rb
CHANGED
data/spec/result_spec.rb
CHANGED
@@ -73,7 +73,7 @@ RSpec.describe Capybara::Result do
|
|
73
73
|
|
74
74
|
#Not a great test but it indirectly tests what is needed
|
75
75
|
it "should evaluate filters lazily" do
|
76
|
-
skip 'JRuby has an issue with lazy enumerator
|
76
|
+
skip 'JRuby has an issue with lazy enumerator evaluation' if RUBY_PLATFORM == 'java'
|
77
77
|
#Not processed until accessed
|
78
78
|
expect(result.instance_variable_get('@result_cache').size).to be 0
|
79
79
|
|
@@ -95,7 +95,7 @@ RSpec.describe Capybara::Result do
|
|
95
95
|
|
96
96
|
context '#each' do
|
97
97
|
it 'lazily evaluates' do
|
98
|
-
skip 'JRuby has an issue with lazy enumerator
|
98
|
+
skip 'JRuby has an issue with lazy enumerator evaluation' if RUBY_PLATFORM == 'java'
|
99
99
|
results=[]
|
100
100
|
result.each do |el|
|
101
101
|
results << el
|
@@ -111,7 +111,7 @@ RSpec.describe Capybara::Result do
|
|
111
111
|
end
|
112
112
|
|
113
113
|
it 'lazily evaluates' do
|
114
|
-
skip 'JRuby has an issue with lazy enumerator
|
114
|
+
skip 'JRuby has an issue with lazy enumerator evaluation' if RUBY_PLATFORM == 'java'
|
115
115
|
result.each.with_index do |el, idx|
|
116
116
|
expect(result.instance_variable_get('@result_cache').size).to eq(idx+1) # 0 indexing
|
117
117
|
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.12.
|
4
|
+
version: 2.12.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: 2017-
|
13
|
+
date: 2017-02-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -452,7 +452,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
452
452
|
version: '0'
|
453
453
|
requirements: []
|
454
454
|
rubyforge_project:
|
455
|
-
rubygems_version: 2.6.
|
455
|
+
rubygems_version: 2.6.10
|
456
456
|
signing_key:
|
457
457
|
specification_version: 4
|
458
458
|
summary: Capybara aims to simplify the process of integration testing Rack applications,
|