Integer Unification for Ruby 2.4.0+
This commit is contained in:
parent
613935c237
commit
83133e201d
|
@ -244,7 +244,7 @@ module Capybara
|
||||||
# manually.
|
# manually.
|
||||||
#
|
#
|
||||||
# @param [Rack Application] app The rack application to run
|
# @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)
|
def run_default_server(app, port)
|
||||||
servers[:webrick].call(app, port, server_host)
|
servers[:webrick].call(app, port, server_host)
|
||||||
|
|
|
@ -108,7 +108,7 @@ Capybara::SpecHelper.spec '#find' do
|
||||||
it "should use the selector when it matches the :for option" do
|
it "should use the selector when it matches the :for option" do
|
||||||
Capybara.add_selector(:beatle) do
|
Capybara.add_selector(:beatle) do
|
||||||
xpath { |num| ".//*[contains(@class, 'beatle')][#{num}]" }
|
xpath { |num| ".//*[contains(@class, 'beatle')][#{num}]" }
|
||||||
match { |value| value.is_a?(Fixnum) }
|
match { |value| value.is_a?(Integer) }
|
||||||
end
|
end
|
||||||
expect(@session.find(:beatle, '2').text).to eq('Paul')
|
expect(@session.find(:beatle, '2').text).to eq('Paul')
|
||||||
expect(@session.find(1).text).to eq('John')
|
expect(@session.find(1).text).to eq('John')
|
||||||
|
|
|
@ -71,7 +71,7 @@ module Capybara
|
||||||
# Get window size.
|
# Get window size.
|
||||||
#
|
#
|
||||||
# @macro about_current
|
# @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
|
def size
|
||||||
@driver.window_size(handle)
|
@driver.window_size(handle)
|
||||||
|
|
|
@ -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.to raise_error('expected to find text matching /No such Text/ in "Text"')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "casts Fixnum to string" do
|
it "casts Integer to string" do
|
||||||
expect do
|
expect do
|
||||||
expect("<h1>Text</h1>").to have_text(3)
|
expect("<h1>Text</h1>").to have_text(3)
|
||||||
end.to raise_error(/expected to find text "3" in "Text"/)
|
end.to raise_error(/expected to find text "3" in "Text"/)
|
||||||
|
|
Loading…
Reference in New Issue