2018-03-04 10:09:32 -05:00
|
|
|
require_relative '../../spec_helper'
|
|
|
|
require_relative 'shared/rest_size'
|
2017-05-07 08:04:49 -04:00
|
|
|
require 'strscan'
|
|
|
|
|
|
|
|
describe "StringScanner#restsize" do
|
2018-01-29 11:08:16 -05:00
|
|
|
it_behaves_like :strscan_rest_size, :restsize
|
2017-05-07 08:04:49 -04:00
|
|
|
|
|
|
|
it "warns in verbose mode that the method is obsolete" do
|
|
|
|
s = StringScanner.new("abc")
|
2019-07-27 06:40:09 -04:00
|
|
|
-> {
|
2017-05-07 08:04:49 -04:00
|
|
|
s.restsize
|
2019-01-20 15:38:57 -05:00
|
|
|
}.should complain(/restsize.*obsolete.*rest_size/, verbose: true)
|
2017-05-07 08:04:49 -04:00
|
|
|
|
2019-07-27 06:40:09 -04:00
|
|
|
-> {
|
2017-05-07 08:04:49 -04:00
|
|
|
s.restsize
|
2019-01-20 15:38:57 -05:00
|
|
|
}.should_not complain(verbose: false)
|
2017-05-07 08:04:49 -04:00
|
|
|
end
|
|
|
|
end
|