Sha256: b7862d695c034a7ce669ea20b6c6771f20a4831c782018177543f9add9350c3f

Contents?: true

Size: 587 Bytes

Versions: 5

Compression:

Stored size: 587 Bytes

Contents

# Copyright (c) 2012, SoundCloud Ltd., Tobias Bielohlawek

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

5 entries across 5 versions & 1 rubygems

Version Path
massive_sitemap-2.1.1 lib/massive_sitemap/writer/string.rb
massive_sitemap-2.1.0 lib/massive_sitemap/writer/string.rb
massive_sitemap-2.0.0 lib/massive_sitemap/writer/string.rb
massive_sitemap-2.0.0.rc8 lib/massive_sitemap/writer/string.rb
massive_sitemap-2.0.0.rc7 lib/massive_sitemap/writer/string.rb