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