Sha256: 6fd75627ffc8d8af660a72269b559ed0211db84d55b79edc5922e697f7842284

Contents?: true

Size: 1.24 KB

Versions: 42

Compression:

Stored size: 1.24 KB

Contents

require 'fwtoolkit/projectfile'
require 'support/project_generator'

describe "FWToolkit::Project" do
  
  class DummyClass
  end

  let!(:project) { ProjectGenerator.new }
  let(:project_folder) { project.project_folder }
  let(:project_class) { DummyClass.new }
  
  before(:each) do
    @project_class.extend FWToolkit::Projectfile
  end

  after(:each) do
    FileUtils.rm_rf(project_folder)
  end

  it "correctly parses a full projectfile" do
    project.create_test_project ProjectGenerator::PRJFILE_COMPLETE_CONFIG
    FWToolkit::Projectfile.load! project_folder
    FWToolkit::Projectfile.config.should == ProjectGenerator::PRJFILE_COMPLETE_CONFIG 
  end

  it "correctly adds defaults to an incomplete projectfile" do
    project.create_test_project ProjectGenerator::PRJFILE_STANDARD_CONFIG
    FWToolkit::Projectfile.load! project_folder
    FWToolkit::Projectfile.config.should == ProjectGenerator::PRJFILE_COMPLETE_CONFIG
  end

  it "raises an exception if the minimal config is not specified" do
    invalid_config = ProjectGenerator::PRJFILE_COMPLETE_CONFIG.clone
    invalid_config.delete(:project_name)

    project.create_test_project invalid_config
    expect { FWToolkit::Projectfile.load! project_folder }.to raise_error(NameError)
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
fwtoolkit-2.6.4 spec/project_config_spec.rb
fwtoolkit-2.6.3 spec/project_config_spec.rb
fwtoolkit-2.6.2 spec/project_config_spec.rb
fwtoolkit-2.6.1 spec/project_config_spec.rb
fwtoolkit-2.6.0 spec/project_config_spec.rb
fwtoolkit-2.5.0 spec/project_config_spec.rb
fwtoolkit-2.4.0 spec/project_config_spec.rb
fwtoolkit-2.3.6 spec/project_config_spec.rb
fwtoolkit-2.3.5 spec/project_config_spec.rb
fwtoolkit-2.3.4 spec/project_config_spec.rb
fwtoolkit-2.3.3 spec/project_config_spec.rb
fwtoolkit-2.3.2 spec/project_config_spec.rb
fwtoolkit-2.3.1 spec/project_config_spec.rb
fwtoolkit-2.3.0 spec/project_config_spec.rb
fwtoolkit-2.2.4 spec/project_config_spec.rb
fwtoolkit-2.2.3 spec/project_config_spec.rb
fwtoolkit-2.2.2 spec/project_config_spec.rb
fwtoolkit-2.2.1 spec/project_config_spec.rb
fwtoolkit-2.2.0 spec/project_config_spec.rb
fwtoolkit-2.1.10 spec/project_config_spec.rb