Sha256: 3a716eba51a8253c6aedd3206ec4a51c166c41bf6d16569a1ed8acd182311849

Contents?: true

Size: 1.42 KB

Versions: 65

Compression:

Stored size: 1.42 KB

Contents

require "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
    results = {}
    b.invoke(:default, :results => results)

    # 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')

    results = {}
    b.invoke :default, :results => results

    # 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

65 entries across 65 versions & 1 rubygems

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