Sha256: 085fb36bd47075028fd20affca87fd3c49b8ed475104f712d0d40fe3661bc4ff

Contents?: true

Size: 1.27 KB

Versions: 20

Compression:

Stored size: 1.27 KB

Contents

require File.join(File.dirname(__FILE__), %w[.. .. .. 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

20 entries across 20 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 spec/lib/models/project/add_target_spec.rb
sproutit-sproutcore-1.0.0.20090408130025 spec/lib/models/project/add_target_spec.rb
sproutit-sproutcore-1.0.0.20090416161445 spec/lib/models/project/add_target_spec.rb
sproutit-sproutcore-1.0.20090721145236 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1046 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1043 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1042 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1037 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1035 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1031 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1030 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1029 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1027 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1028 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1026 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1025 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1024 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1009 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1008 spec/lib/models/project/add_target_spec.rb
sproutcore-1.0.1003 spec/lib/models/project/add_target_spec.rb