Sha256: 9d005ad2f9ae33ac1bb9779ef25290216c2573dfba7096892d50ffdafb06779f

Contents?: true

Size: 1.43 KB

Versions: 20

Compression:

Stored size: 1.43 KB

Contents

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

describe SC::Buildfile, 'load' do

  include SC::SpecHelpers

  it "should load the contents of the buildfile as well as imports" do
    p = fixture_path('buildfiles', 'basic', 'Buildfile')
    b = SC::Buildfile.load(p)
    
    b.should_not be_nil
    b.invoke(:default)
    
    # Found in Buildfile
    RESULTS[:test_task1].should be_true
    
    # Found in import(task_module)
    RESULTS[:imported_task].should be_true
  end
  
  it "should be able to load the contents of one builfile on top of another" do
    a = SC::Buildfile.load(fixture_path('buildfiles','installed', 'Buildfile'))
    b = a.dup.load! fixture_path('buildfiles','basic', 'Buildfile')
    
    b.invoke :default
    
    # Found in Buildfile
    RESULTS[:test_task1].should be_true
    
    # Found in installed/Buildfile
    RESULTS[:installed_task].should be_true
  end
  
  it "should store every loaded path in loaded_paths" do
    ## IMPORTANT! The buildfiles loaded here are not important, but they must
    ## not contain any 'import' directives or else this test will fail.
    path1 = fixture_path('buildfiles','installed', 'Buildfile')
    path2 = fixture_path('buildfiles','installed', 'Buildfile2')
    
    a = SC::Buildfile.new
    a.load! path1
    a.load! path2
    
    a.loaded_paths.size.should eql(2)
    a.loaded_paths.should include(path1)
    a.loaded_paths.should include(path2)
  end
    
end

Version data entries

20 entries across 20 versions & 2 rubygems

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