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.6.0.1 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.1-x86-mingw32 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0-java spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.rc.2-x86-mingw32 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.rc.2 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.rc.2-java spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.rc.1-x86-mingw32 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.rc.1 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.rc.1-java spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.beta.3-x86-mingw32 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.beta.3-java spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.beta.3 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.beta.2-x86-mingw32 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.beta.2-java spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.beta.2 spec/lib/buildfile/load_spec.rb
sproutcore-1.6.0.beta.1 spec/lib/buildfile/load_spec.rb
sproutcore-1.5.0-java spec/lib/buildfile/load_spec.rb
sproutcore-1.5.0 spec/lib/buildfile/load_spec.rb
sproutcore-1.5.0.rc.2 spec/lib/buildfile/load_spec.rb