Sha256: 2f5761d4af3594db70b641be2814880a23defe9c0c7d7548bcab23dad06f8c1e

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 Bytes

Contents

require File.expand_path('../shared/matched_size.rb', __FILE__)
require 'strscan'

ruby_version_is "" ... "1.9" do
  describe "StringScanner#matchedsize" do
    it_behaves_like(:strscan_matched_size, :matchedsize)

    it "warns in verbose mode that the method is obsolete" do
      s = StringScanner.new("abc")
      begin
        old = $VERBOSE
        lambda {
          $VERBOSE = true
          s.matchedsize
        }.should complain(/matchedsize.*obsolete.*matched_size/)

        lambda {
          $VERBOSE = false
          s.matchedsize
        }.should_not complain
      ensure
        $VERBOSE = old
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-strscan-1.0.1 spec/matchedsize_spec.rb
rubysl-strscan-1.0.0 spec/matchedsize_spec.rb
rubysl-strscan-2.0.0 spec/matchedsize_spec.rb