Sha256: db3d887cd41abdd534a9dc295e7320192d18e45aac48d20e3cc1cf2aa05e357c

Contents?: true

Size: 994 Bytes

Versions: 4

Compression:

Stored size: 994 Bytes

Contents

require 'spec_helper'
require 'recursive-open-struct'

describe New::Project do
  let(:template_dir){ File.join(New::TEMP_DIR, 'custom_bar_template') }
  let(:project_dir){ File.join(New::TEMP_DIR, 'new_project') }
  let(:project){ New::Project.new(:custom_bar_template, :new_project) }
  let(:project_config) { YAML.load(File.open(File.join(project_dir, New::CONFIG_FILE))).deep_symbolize_keys! }

  before do
    Dir.chdir New::TEMP_DIR
    FileUtils.cp_r root('spec', 'fixtures', 'custom', 'templates', 'custom_bar_template'), New::TEMP_DIR
    New::Template.stub(:new).and_return(RecursiveOpenStruct.new({ options: {}, dir: template_dir }))
    project
  end

  after do
    New::Template.unstub(:new)
    FileUtils.rm_rf template_dir
    FileUtils.rm_rf project_dir
  end

  it 'should copy the template' do
    expect(Dir.exists?(project_dir)).to eq true
  end

  it 'should create a config file' do
    expect(File.exists?(File.join(project_dir, New::CONFIG_FILE))).to eq true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
new-0.0.4 spec/lib/new/project_spec.rb
new-0.0.3 spec/lib/new/project_spec.rb
new-0.0.2 spec/lib/new/project_spec.rb
new-0.0.0 spec/lib/new/project_spec.rb