Sha256: 71b001fe3ae3e4fb747ab60aebe4bb1c8e15ff01342e862a423f95dcf165a993

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

require 'spec_helper'

describe Taza::PartialGenerator do

  before(:each) do
    capture_stdout { Taza::SiteGenerator.new(['foo_site']).site }
  end

  context "taza partial navigation foo_site" do
    context "creates" do

      let(:subject) { Taza::PartialGenerator.new(['navigation', 'foo_site']) }
      let(:output) { capture_stdout { subject.partial } }

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

      it 'message if site does not exist' do
        bar_page = capture_stdout { Taza::PartialGenerator.new(['navigation', 'bar_site']).partial }
        expect(bar_page).to include("No such site bar_site exists")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
taza-3.0.0 spec/generators/partial_generator_spec.rb