Sha256: a1bebf1dbec6e41f2a68db2388e656c1b23450e131ba83d603356285dd40092e

Contents?: true

Size: 1.95 KB

Versions: 3

Compression:

Stored size: 1.95 KB

Contents

describe 'xcbootstrap for a sample project' do
  before(:all) do
    @test_output_directory = File.join(File.dirname(__FILE__), '../../test_output')
    @bootstrap_output = File.join(@test_output_directory, '/Output')
    @xcbootstrap = File.expand_path(File.join(File.dirname(__FILE__), '../../bin/xcbootstrap'))
  end
  
  context 'with full option names' do
    before(:all) do
      FileUtils.rm_rf @test_output_directory
      @xcbootstrap_result = system("#{@xcbootstrap} --template Sample --project #{@bootstrap_output}")
    end
    
    it 'should run successfully' do
      @xcbootstrap_result.should be_true
    end
  
    it 'should have created the output directory' do
      File.exists?(@bootstrap_output).should be_true
    end
  
    it 'should have created source and test directories' do
      File.directory?(File.join(@bootstrap_output, "Output")).should be_true
      File.directory?(File.join(@bootstrap_output, "OutputTests")).should be_true
    end
  
    it 'should have created all the project files' do
      output_files = Dir.glob("#{@bootstrap_output}/**/{.*,*}").select { |file| !File.directory?(file) }
      output_files.size.should == 13
    end
  
    it 'should have the git ignore file renamed' do
      File.exists?(File.join(@bootstrap_output, ".gitignore")).should be_true
    end
  
    it 'should have replaced the template with the project name' do
      content = File.read(File.join(@bootstrap_output, "Output.xcodeproj/project.pbxproj"))
      content.should_not include("Sample")
      content.should include("Output")
    end
  end
  
  context 'with short option names' do
    before(:all) do
      FileUtils.rm_rf @test_output_directory
      @xcbootstrap_result = system("#{@xcbootstrap} -t Sample -p #{@bootstrap_output}")
    end
    
    it 'should run successfully' do
      @xcbootstrap_result.should be_true
    end
  
    it 'should have created the output directory' do
      File.exists?(@bootstrap_output).should be_true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xcbootstrap-0.0.3 spec/acceptance/xcbootstrap_spec.rb
xcbootstrap-0.0.2 spec/acceptance/xcbootstrap_spec.rb
xcbootstrap-0.0.1 spec/acceptance/xcbootstrap_spec.rb