Sha256: e6beb84a38b4a29838935501f10eee606de347e51e1b7ed6b433747e1dbe04a5

Contents?: true

Size: 1.2 KB

Versions: 65

Compression:

Stored size: 1.2 KB

Contents

require "spec_helper"

describe SC::Project, 'add_target' do

  include SC::SpecHelpers

  before do
    @project = SC::Project.new fixture_path('buildfiles', 'empty_project')
  end

  it "should add a target with the passed name" do
    @project.add_target :target_name, :target_type
    target = @project.targets[:target_name]
    target.should_not be_nil
    target.target_name.should eql(:target_name)
    target.target_type.should eql(:target_type)
  end

  it "should set the target.project automatically" do
    @project.add_target :target_name, :target_type
    @project.targets[:target_name].project.should eql(@project)
  end

  it "should set any other passed options on the target itself" do
    @project.add_target :target_name, :target_type, :foo => :foo, :bar => :bar
    target = @project.targets[:target_name]

    target.should_not be_nil
    target.foo.should eql(:foo)
    target.bar.should eql(:bar)
  end

  it "should replace an existing target if defined" do
    @project.add_target :test1, :dummy
    target1 = @project.targets[:test1]

    @project.add_target :test1, :dummy2
    target2 = @project.targets[:test1]

    target2.should_not eql(target1)
    target2.target_type.should eql(:dummy2)
  end

end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
sproutcore-1.11.0 spec/lib/models/project/add_target_spec.rb
sproutcore-1.11.0.rc3 spec/lib/models/project/add_target_spec.rb
sproutcore-1.11.0.rc2 spec/lib/models/project/add_target_spec.rb
sproutcore-1.11.0.rc1 spec/lib/models/project/add_target_spec.rb
sproutcore-1.10.3.1 spec/lib/models/project/add_target_spec.rb
sproutcore-1.10.2 spec/lib/models/project/add_target_spec.rb
sproutcore-1.10.1 spec/lib/models/project/add_target_spec.rb
sproutcore-1.10.0 spec/lib/models/project/add_target_spec.rb
sproutcore-1.10.0.rc.3 spec/lib/models/project/add_target_spec.rb
sproutcore-1.10.0.rc.2 spec/lib/models/project/add_target_spec.rb
sproutcore-1.10.0.rc.1 spec/lib/models/project/add_target_spec.rb
sproutcore-1.9.2 spec/lib/models/project/add_target_spec.rb
sproutcore-1.9.1 spec/lib/models/project/add_target_spec.rb
sproutcore-1.9.0 spec/lib/models/project/add_target_spec.rb
sproutcore-1.8.2.1 spec/lib/models/project/add_target_spec.rb
sproutcore-1.8.1 spec/lib/models/project/add_target_spec.rb
sproutcore-1.8.0 spec/lib/models/project/add_target_spec.rb
sproutcore-1.7.1.beta-java spec/lib/models/project/add_target_spec.rb
sproutcore-1.7.1.beta spec/lib/models/project/add_target_spec.rb
sproutcore-1.6.0.1-java spec/lib/models/project/add_target_spec.rb