Sha256: a88fa629a23750a763f8240080f642f81a494072ea771b365c8800efd67a8b2b

Contents?: true

Size: 702 Bytes

Versions: 29

Compression:

Stored size: 702 Bytes

Contents

require 'spec_helper'

describe "Templates class" do

  it "should provide method access to each template" do
    SitemapGenerator::Templates::FILES.each do |name, file|
      SitemapGenerator.templates.send(name).should_not be(nil)
      SitemapGenerator.templates.send(name).should == File.read(File.join(SitemapGenerator.root, 'templates', file))
    end
  end

  describe "templates" do
    before :each do
      SitemapGenerator.templates.sitemap_sample = nil
      File.expects(:read).returns('read file')
    end

    it "should only be read once" do
      File.expects(:read).once
      SitemapGenerator.templates.sitemap_sample
      SitemapGenerator.templates.sitemap_sample
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
sitemap_generator-5.2.0 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.1.0 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.5 spec/sitemap_generator/templates_spec.rb
ftbpro_sitemap_generator-5.0.8 spec/sitemap_generator/templates_spec.rb
sitemap_generator_ftbpro-5.0.6 spec/sitemap_generator/templates_spec.rb
sitemap_generator_ftbpro-5.0.5 spec/sitemap_generator/templates_spec.rb
sitemap_generator_ftbpro-5.0.4 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.4 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.3 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.2 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.1 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.0 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.0.beta1 spec/sitemap_generator/templates_spec.rb
sitemap_generator-5.0.0.beta spec/sitemap_generator/templates_spec.rb
sitemap_generator-4.3.1 spec/sitemap_generator/templates_spec.rb
sitemap_generator-4.3.0 spec/sitemap_generator/templates_spec.rb
sitemap_generator-4.2.0 spec/sitemap_generator/templates_spec.rb
sitemap_generator-4.1.1 spec/sitemap_generator/templates_spec.rb
sitemap_generator-4.1.0 spec/sitemap_generator/templates_spec.rb
sitemap_generator-4.0.1 spec/sitemap_generator/templates_spec.rb