Skip to content

Commit

Permalink
Fix rspec-wait deprecation; Upgrade rspec-wait to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
triskweline committed Jun 21, 2024
1 parent edf0298 commit 5281165
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rspec-wait (0.0.10)
rspec (>= 3.0)
rspec-wait (1.0.0)
rspec (>= 3.4)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.1.0)
Expand Down
42 changes: 21 additions & 21 deletions spec/features/synchronization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

describe 'dynamically inserted images' do
Expand All @@ -42,7 +42,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished

expect('img').to be_loaded_image
end
Expand All @@ -68,7 +68,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished

expect('img').to be_broken_image
end
Expand All @@ -86,7 +86,7 @@
command = ObservableCommand.new { page.find('a').click }
command.execute

wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished

expect('img').to be_loaded_image
end
Expand All @@ -113,7 +113,7 @@
command = ObservableCommand.new { page.find('a').click }
command.execute

wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished

expect(server_spy).to_not have_received(:reached)
end
Expand Down Expand Up @@ -143,7 +143,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

it 'waits until the iframe has failed to load' do
Expand All @@ -167,7 +167,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

it 'does not wait forever for an iframe with a data: source' do
Expand All @@ -183,7 +183,7 @@
command = ObservableCommand.new { page.find('a').click }
command.execute

wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished
end

it 'does not wait for an iframe with [loading=lazy]' do
Expand All @@ -208,7 +208,7 @@
command = ObservableCommand.new { page.find('a').click }
command.execute

wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished

expect(server_spy).to_not have_received(:reached)
end
Expand Down Expand Up @@ -238,7 +238,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished

expect('video').to be_media_element_with_metadata
end
Expand All @@ -264,7 +264,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

it 'does not wait forever for a video with a data: source' do
Expand All @@ -279,7 +279,7 @@
visit '/start'
command = ObservableCommand.new { page.find('a').click }
command.execute
wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished
expect('video').to be_media_element_with_metadata
end

Expand All @@ -302,7 +302,7 @@
visit '/start'
command = ObservableCommand.new { page.find('a').click }
command.execute
wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished

expect(server_spy).to_not have_received(:reached)

Expand Down Expand Up @@ -331,7 +331,7 @@
command = ObservableCommand.new { page.find('a').click }
command.execute

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished

expect('audio').to be_media_element_with_metadata
end
Expand All @@ -358,7 +358,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

it 'does not wait forever for a audio with a data: source' do
Expand All @@ -374,7 +374,7 @@
visit '/start'
command = ObservableCommand.new { page.find('a').click }
command.execute
wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished
expect('audio').to be_media_element_with_metadata
end

Expand All @@ -398,7 +398,7 @@
visit '/start'
command = ObservableCommand.new { page.find('a').click }
command.execute
wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished

expect(server_spy).to_not have_received(:reached)

Expand Down Expand Up @@ -432,7 +432,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

it 'waits until a <script type="module"> has loaded' do
Expand All @@ -459,7 +459,7 @@

wall.release

wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

it 'does not wait for a <script> with a non-JavaScript [type]' do
Expand All @@ -483,7 +483,7 @@

command = ObservableCommand.new { page.find('a').click }
command.execute
wait(0.5.seconds).for(command).to be_finished
wait(0.5.seconds).for { command }.to be_finished
end

it 'does not wait forever for an inline script' do
Expand All @@ -506,7 +506,7 @@

command = ObservableCommand.new { page.find('a').click }
command.execute
wait(0.1.seconds).for(command).to be_finished
wait(0.1.seconds).for { command }.to be_finished

expect(evaluate_script('EFFECT')).to eq(123)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/matchers/run_into_wall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
command.execute

expect(command).to be_running
wait(0.5.seconds).for(wall).to be_blocking
wait(0.5.seconds).for { wall }.to be_blocking

sleep(0.25.seconds)
expect(command).to be_running
Expand Down

0 comments on commit 5281165

Please sign in to comment.