Sha256: 499eae6f8594235476400192f3dc598746dc12e3c42d5a3643e3ab197c6bee7e

Contents?: true

Size: 912 Bytes

Versions: 20

Compression:

Stored size: 912 Bytes

Contents

require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])

describe SC::Project, 'target_for' do

  include SC::SpecHelpers

  before do
    @project = fixture_project(:real_world)
  end
  
  it "should lookup absolute target names (/foo) from the top" do
    target = @project.target_for('/sproutcore')
    target.should_not be_nil
    target.target_name.to_s.should eql('/sproutcore')
  end
  
  it "should lookup relative target names from the top (like absolute)" do
    target = @project.target_for(:sproutcore)
    target.should_not be_nil
    target.target_name.to_s.should eql('/sproutcore')
  end
  
  it "should return nil if no matching target could be found" do
    target = @project.target_for(:does_not_exist)
    target.should be_nil
  end
  
  it "should NOT call prepare! on new targets" do
    target = @project.target_for(:contacts)
    target.prepared?.should be_false
  end
  
end

Version data entries

20 entries across 20 versions & 2 rubygems

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