Sha256: 63f0ad15b8e7cccf39e20f7bb202aea50423874cc2db62568f91575ae739f26f

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

require 'logirel/initer'
require 'logirel/version'
require 'logirel/nuget'
require 'logirel/initer'
require 'construct'
require 'FileUtils'
require File.dirname(__FILE__) + '/../support/with_sample_projects'
include Logirel

describe Initer, "setting up folder structure" do
  
  before(:each) do
    @tmp = "fs-" + rand().to_s
	@tmp_bs = "buildscripts"
	Dir.mkdir(@tmp)	
	@r = Initer.new(@tmp, @tmp_bs)
	@r.create_structure
	@bs = File.join(@r.root_path, @r.buildscripts_path)
  end
  
  subject { @r }
  
  after(:each) do
	FileUtils.rm_rf(@tmp) while Dir.exists?(@tmp)
  end
  
  it { should respond_to :root_path }
  
  context "when we have an existing project" do
    before {
	  abc_projects(@r.root_path)
	}
	it "initer should correctly parse the names of existing projects" do
      @r.parse_folders.should =~ ['A', 'C']
    end
  end
  
  it "should create the correct folder structure" do
	@r.create_structure
	Dir.exists?(@bs).should be_true
	Dir.exists?(File.join(@tmp, "src")).should be_true
  end
  
  it "should create environment.rb" do
    @r.init_environement_rb
	File.exists?(File.join(@bs, "environment.rb")).should be_true
  end
  
  it "should create project_details.rb" do
	@r.init_project_details([{
	    :ruby_key => "p_ruby", 
		:dir => "p_dir"
	  }])
	File.exists?(File.join(@bs, "project_details.rb")).should be_true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logirel-0.0.15 spec/filesystem/filestructure_spec.rb