Integer Unification for Ruby 2.4.0+

This commit is contained in:
Koichi ITO 2016-12-17 00:03:53 +09:00
parent 613935c237
commit 83133e201d
4 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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')

View File

@ -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)

View File

@ -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("<h1>Text</h1>").to have_text(3)
end.to raise_error(/expected to find text "3" in "Text"/)