Sha256: 4ee7e89ff47226ef42f4ab2655f2fab530a482ad7369b4a939168dbb603624ec

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require_relative '../helper'
require 'author/commands/generator'

describe Author::Commands::Generator do
  
  it "should require a name" do
    output = capture(:stderr) { Author::Commands::Generator.start }
    expect(output).to_include "No value provided for required arguments 'name'"
  end
  
  it "should create project structure" do
    play_in_sandbox do
      capture(:stdout) { Author::Commands::Generator.start ['abook'] }
      
      'abook'.must_be_a_directory
      'abook/chapters'.must_be_a_directory
      'abook/export'.must_be_a_directory
      'abook/templates'.must_be_a_directory
    end
  end
  
  it "should create project files" do
    play_in_sandbox do
      capture { Author::Commands::Generator.start ['ihazfiles']}
      
      'ihazfiles/config.yml'.must_be_a_file
      'ihazfiles/Gemfile'.must_be_a_file
      'ihazfiles/outline.txt'.must_be_a_file
      'ihazfiles/chapters/sample.md'.must_be_a_file
      'ihazfiles/templates/layout.xhtml'.must_be_a_file
    end
  end
  
  it "should run bundler for the new project" do
    play_in_sandbox do
      output = capture(:stdout) { Author::Commands::Generator.start ['bundled'] }
      expect(output).to_include "Bundling gems"
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
author-1.1.0.alpha test/commands/generator_test.rb