Sha256: 3f481e6501904d0b12dec87c7aa48ff67824815bc5d48fa96569046562ffe2e1

Contents?: true

Size: 528 Bytes

Versions: 3

Compression:

Stored size: 528 Bytes

Contents

require 'stringio'
require "massive_sitemap/writer/base"

# Write into String
# Perfect for testing porpuses
module MassiveSitemap
  module Writer

    class String < Base
      # accessors to conent, mainly used in tests
      def to_s
        @string.string rescue ""
      end

      def ==(other_string)
        to_s == other_string
      end

      def include?(other_string)
        to_s.include?(other_string)
      end

      protected
      def open_stream
        @string ||= StringIO.new
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
massive_sitemap-2.0.0.rc6 lib/massive_sitemap/writer/string.rb
massive_sitemap-2.0.0.rc5 lib/massive_sitemap/writer/string.rb
massive_sitemap-2.0.0.rc4 lib/massive_sitemap/writer/string.rb