Sha256: 93064b1569ce8f66c623263601559b726f7eaa0eca20b482d9e074eba5b17ecc

Contents?: true

Size: 783 Bytes

Versions: 2

Compression:

Stored size: 783 Bytes

Contents

require "spec_helper"

require "massive_sitemap/builder/index"
require "massive_sitemap/writer/string"

describe MassiveSitemap::Builder::Index do
  INDEX_HEADER = %Q(<?xml version="1.0" encoding="UTF-8"?>\n<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n<sitemap>)

  let(:writer) { MassiveSitemap::Writer::String.new }

  before do
    writer.stub!(:streams).and_return(['test'])
  end

  it 'generates one url' do
    MassiveSitemap::Builder::Index.new(writer, :indent_by => 0)

    writer.should == %Q(#{INDEX_HEADER}\n<loc>/test</loc>\n</sitemap>\n</sitemapindex>)
  end

  it 'include base_url' do
    MassiveSitemap::Builder::Index.new(writer, :base_url => "test.de", :indent_by => 0)
    writer.should include("<loc>http://test.de/test</loc>")
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
massive_sitemap-2.0.0.rc2 spec/builder/index_spec.rb
massive_sitemap-2.0.0.rc1 spec/builder/index_spec.rb