From 83133e201df4363cffc41c689331e23119b40546 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sat, 17 Dec 2016 00:03:53 +0900 Subject: [PATCH] Integer Unification for Ruby 2.4.0+ --- lib/capybara.rb | 2 +- lib/capybara/spec/session/find_spec.rb | 2 +- lib/capybara/window.rb | 2 +- spec/rspec/shared_spec_matchers.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/capybara.rb b/lib/capybara.rb index 703834a8..95d5b724 100644 --- a/lib/capybara.rb +++ b/lib/capybara.rb @@ -244,7 +244,7 @@ module Capybara # manually. # # @param [Rack Application] app The rack application to run - # @param [Fixnum] port The port to run the application on + # @param [Integer] port The port to run the application on # def run_default_server(app, port) servers[:webrick].call(app, port, server_host) diff --git a/lib/capybara/spec/session/find_spec.rb b/lib/capybara/spec/session/find_spec.rb index 157340ca..cfa3a22a 100644 --- a/lib/capybara/spec/session/find_spec.rb +++ b/lib/capybara/spec/session/find_spec.rb @@ -108,7 +108,7 @@ Capybara::SpecHelper.spec '#find' do it "should use the selector when it matches the :for option" do Capybara.add_selector(:beatle) do xpath { |num| ".//*[contains(@class, 'beatle')][#{num}]" } - match { |value| value.is_a?(Fixnum) } + match { |value| value.is_a?(Integer) } end expect(@session.find(:beatle, '2').text).to eq('Paul') expect(@session.find(1).text).to eq('John') diff --git a/lib/capybara/window.rb b/lib/capybara/window.rb index 189c5d9f..a6f89348 100644 --- a/lib/capybara/window.rb +++ b/lib/capybara/window.rb @@ -71,7 +71,7 @@ module Capybara # Get window size. # # @macro about_current - # @return [Array<(Fixnum, Fixnum)>] an array with width and height + # @return [Array<(Integer, Integer)>] an array with width and height # def size @driver.window_size(handle) diff --git a/spec/rspec/shared_spec_matchers.rb b/spec/rspec/shared_spec_matchers.rb index 60b5d15e..e204fe50 100644 --- a/spec/rspec/shared_spec_matchers.rb +++ b/spec/rspec/shared_spec_matchers.rb @@ -372,7 +372,7 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, mode| end.to raise_error('expected to find text matching /No such Text/ in "Text"') end - it "casts Fixnum to string" do + it "casts Integer to string" do expect do expect("

Text

").to have_text(3) end.to raise_error(/expected to find text "3" in "Text"/)