mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Add a test to identify when JRuby fixes lazy enumeration
This commit is contained in:
parent
aeedcbf578
commit
26bc517afe
1 changed files with 16 additions and 0 deletions
|
@ -143,4 +143,20 @@ RSpec.describe Capybara::Result do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'lazy select', :focus_ do
|
||||||
|
it 'is compatible' do
|
||||||
|
# This test will let us know when JRuby fixes lazy select so we can re-enable it in Result
|
||||||
|
pending 'JRuby has an issue with lazy enumberator evaluation' if RUBY_PLATFORM == 'java'
|
||||||
|
eval_count = 0
|
||||||
|
enum = ["Text1", "Text2", "Text3"].lazy.select do |t|
|
||||||
|
eval_count += 1
|
||||||
|
true
|
||||||
|
end
|
||||||
|
expect(eval_count).to eq 0
|
||||||
|
enum.next
|
||||||
|
sleep 1
|
||||||
|
expect(eval_count).to eq 1
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue