capybara 2.12.0 → 2.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +6 -0
  3. data/lib/capybara/queries/current_path_query.rb +1 -1
  4. data/lib/capybara/queries/selector_query.rb +3 -3
  5. data/lib/capybara/result.rb +6 -6
  6. data/lib/capybara/selector.rb +3 -3
  7. data/lib/capybara/session.rb +1 -1
  8. data/lib/capybara/spec/views/buttons.erb +1 -1
  9. data/lib/capybara/spec/views/fieldsets.erb +1 -1
  10. data/lib/capybara/spec/views/form.erb +1 -1
  11. data/lib/capybara/spec/views/frame_child.erb +1 -1
  12. data/lib/capybara/spec/views/frame_one.erb +1 -1
  13. data/lib/capybara/spec/views/frame_parent.erb +1 -1
  14. data/lib/capybara/spec/views/frame_two.erb +1 -1
  15. data/lib/capybara/spec/views/header_links.erb +1 -1
  16. data/lib/capybara/spec/views/host_links.erb +1 -1
  17. data/lib/capybara/spec/views/path.erb +1 -1
  18. data/lib/capybara/spec/views/popup_one.erb +1 -1
  19. data/lib/capybara/spec/views/popup_two.erb +1 -1
  20. data/lib/capybara/spec/views/postback.erb +1 -1
  21. data/lib/capybara/spec/views/tables.erb +1 -1
  22. data/lib/capybara/spec/views/with_base_tag.erb +1 -1
  23. data/lib/capybara/spec/views/with_count.erb +1 -1
  24. data/lib/capybara/spec/views/with_hover.erb +1 -1
  25. data/lib/capybara/spec/views/with_html.erb +1 -1
  26. data/lib/capybara/spec/views/with_html_entities.erb +1 -1
  27. data/lib/capybara/spec/views/with_js.erb +1 -1
  28. data/lib/capybara/spec/views/with_scope.erb +1 -1
  29. data/lib/capybara/spec/views/with_simple_html.erb +1 -1
  30. data/lib/capybara/spec/views/with_title.erb +1 -1
  31. data/lib/capybara/spec/views/with_windows.erb +1 -1
  32. data/lib/capybara/spec/views/within_frames.erb +1 -1
  33. data/lib/capybara/version.rb +1 -1
  34. data/spec/result_spec.rb +3 -3
  35. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc177e8165f5b72a1dc1c1303b726701bc24254c
4
- data.tar.gz: dab6b087b3ef03904d496bef6d3f66e2736b5bbd
3
+ metadata.gz: 366aecdcbfc57f6102bd9216645cfdb69dea2f0e
4
+ data.tar.gz: 989edd37eea1f619de795362350584f25af60b17
5
5
  SHA512:
6
- metadata.gz: f21cbebab1e87a9b9a411caf05acab9d912257604d6004db90af7439a692b862966e11291134424105698477b772cca46774aa95aad6ab78bdecd827ab862e83
7
- data.tar.gz: c643a679ac6ac6cf17f03d63f74a97a20919980eead96c30b8b8c571120b19e0f94d2b7be978878580c6365483cc41476a83710b96200559e6be124dce620af0
6
+ metadata.gz: ccd1760a40ac203ebf7ba2b38104e64e9eea0446ccc596898b8467f5c0471f37e003ca84616c82843426928b6997d7be3b748beb85aa00e34a70573551027427
7
+ data.tar.gz: 7d51a1a4fc3c405774710bd4eae7d922fa1957d5900f50c68a5f58c70f762d73d11ac00964654c7408320c10c4b401dea588e3eec35f9cc3f13482a42aca1362
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ #Version 2.12.1
2
+ Release date: 2017-02-16
3
+
4
+ ### Fixed
5
+ * Disable lazy Capybara::Results evaluation for JRuby due to ongoing issues
6
+
1
7
  #Version 2.12.0
2
8
  Release date: 2017-01-22
3
9
 
@@ -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 === true} text #{options[:text].inspect}" if options[: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 === true
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
- exact_text = options.fetch(:exact_text, Capybara.exact_text)
208
+ options.fetch(:exact_text, Capybara.exact_text)
209
209
  end
210
210
  end
211
211
  end
@@ -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
- if @elements.respond_to? :lazy #Ruby 2.0+
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|
@@ -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] === false)
12
- states << 'not checked' if options[:unchecked] || (options[:checked] === false)
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] === false
16
+ desc << " without the multiple attribute" if options[:multiple] == false
17
17
  desc
18
18
  end
19
19
  end
@@ -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,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <h1>Buttons</h1>
3
3
  <button>Click me!</button>
4
4
  <button id="click_me_123">Click me by id!</button>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <form action="/form" method="post">
3
3
  <fieldset id="agent_fieldset">
4
4
  <legend>Agent</legend>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <h1>Form</h1>
3
3
 
4
4
  <form action="/form" method="post">
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>This is the child frame title</title>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>This is the title of frame one</title>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>This is the parent frame title</title>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>This is the title of frame two</title>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <p>
3
3
  <a href="/get_header">Link</a>
4
4
  </p>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <p>
3
3
  <a href="/host">Relative Host</a>
4
4
  <a href="<%= params[:absolute_host] %>/host">Absolute Host</a>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3
3
  <body>
4
4
  <div>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>Title of the first popup</title>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>Title of popup two</title>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <h1>Postback</h1>
3
3
 
4
4
  <form method="get">
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <form action="/form" method="post">
3
3
  <table id="agent_table">
4
4
  <caption>Agent</caption>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3
3
  <head>
4
4
  <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <h1>This page is used for testing number options of has_text?</h1>
3
3
 
4
4
  <p>count1</p>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3
3
  <head>
4
4
  <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <div id="referrer"><%= referrer %></div>
3
3
  <h1>This is a test</h1>
4
4
 
@@ -1,2 +1,2 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  Encoding with &mdash; html entities &raquo;
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3
3
  <head>
4
4
  <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <h1>This page is used for testing various scopes</h1>
3
3
 
4
4
  <p id="for_foo">
@@ -1,2 +1,2 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  Bar
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <title>Test Title</title>
3
3
  <body>
4
4
  <svg><title>abcdefg</title></svg>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>With Windows</title>
@@ -1,4 +1,4 @@
1
- <%# frozen_string_literal: true %>
1
+
2
2
  <html>
3
3
  <head>
4
4
  <title>With Frames</title>
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Capybara
3
- VERSION = '2.12.0'
3
+ VERSION = '2.12.1'
4
4
  end
@@ -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 next evaluation' if RUBY_PLATFORM == 'java' && (Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('9.1.6.0'))
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 next evaluation' if RUBY_PLATFORM == 'java' && (Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('9.1.6.0'))
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 next evaluation' if RUBY_PLATFORM == 'java' && (Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('9.1.6.0'))
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.0
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-01-22 00:00:00.000000000 Z
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.8
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,