Sha256: 6cdc1dbb6a76542088e4fd4533989a29d748b83b31ae666f0cbbca4ace684b1a

Contents?: true

Size: 1.82 KB

Versions: 3

Compression:

Stored size: 1.82 KB

Contents

require 'spec_helper'

describe Taza::SiteGenerator do
  context "taza site foo_site" do
    context "creates" do

      let(:subject) { Taza::SiteGenerator.new(['foo_site']) }
      let(:output) { capture(:stdout) { subject.site } }

      it 'foo_site.rb' do
        expect(output).to include('lib/sites/foo_site.rb')
        expect(File.exists?('lib/sites/foo_site.rb')).to be true
      end

      it 'lib/sites/foo_site' do
        expect(output).to include('lib/sites/foo_site')
        expect(File.directory?('lib/sites/foo_site')).to be true
      end

      it 'lib/sites/foo_site/flows' do
        expect(output).to include("lib/sites/foo_site/flows")
        expect(File.directory?('lib/sites/foo_site/flows')).to be true
      end

      it 'lib/sites/foo_site/pages' do
        expect(output).to include("lib/sites/foo_site/pages")
        expect(File.directory?('lib/sites/foo_site/pages')).to be true
      end

      it 'lib/sites/foo_site/pages/partials' do
        expect(output).to include("lib/sites/foo_site/pages/partials")
        expect(File.directory?('lib/sites/foo_site/pages/partials')).to be true
      end

      it 'config/foo_site.yml' do
        expect(output).to include("config/foo_site.yml")
        expect(File.exists?('config/foo_site.yml')).to be true
      end

      it 'does not overwrite existing site' do
        capture(:stdout) { Taza::SiteGenerator.new(['foo_site']).site }
        expect(output).to include(*["identical", "exist"])
      end

      it "generates a site that can uses the block given in new" do
        skip 'will have to fix this later'
        @site_class = generate_site(@site_name)
        stub_settings
        stub_browser
        foo = nil
        @site_class.new { |site| foo = site }
        expect(foo).to_not be_nil
        expect(foo).to be_a_kind_of Taza::Site
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
taza-2.1.0 spec/generators/site_generator_spec.rb
taza-2.0 spec/generators/site_generator_spec.rb
taza-1.0 spec/generators/site_generator_spec.rb