Sha256: 0a691b0eb22a5bf8e60342188c431e8e0f0de1a3ee73e23bd07ff6f4ef552d98

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path('../../helper', __FILE__)

describe "Zen::Theme" do

  it 'Error when retrieving a theme when no themes exist' do
    should.raise?(Zen::ThemeError) { Zen::Theme[:spec] }
  end

  it 'Add a new theme' do
    Zen::Theme.add do |t|
      t.name      = 'spec'
      t.author    = 'Yorick Peterse'
      t.about     = 'An example theme'
      t.templates = __DIR__
      t.public    = __DIR__
      t.env.name  = 'Zen'
      t.env.foo   = {:foo => 'bar'}
    end

    should.not.raise?(Zen::ThemeError) { Zen::Theme[:spec] }

    theme = Zen::Theme[:spec]

    theme.name.should      == :spec
    theme.author.should    == 'Yorick Peterse'
    theme.templates.should == __DIR__
    theme.env.name.should  == 'Zen'
    theme.env.foo.should   == {:foo => 'bar'}
  end

  it 'Add an already existing theme' do
    should.raise?(Zen::ValidationError) do
      Zen::Theme.add do |t|
        t.name         = 'spec'
        t.author       = 'Yorick Peterse'
        t.about        = 'An example theme'
        t.templates = __DIR__
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zen-0.4.3 spec/zen/theme.rb
zen-0.4.2 spec/zen/theme.rb
zen-0.4.1 spec/zen/theme.rb
zen-0.4 spec/zen/theme.rb