Sha256: 3f4146c262ff613bcf2cd98610241781aa21bc381cc8b4dcac7541912f77160c

Contents?: true

Size: 1.55 KB

Versions: 24

Compression:

Stored size: 1.55 KB

Contents

require File.join(File.dirname(__FILE__), 'spec_helper')

describe "manifest:catalog" do
  
  include SC::SpecHelpers
  include SC::ManifestSpecHelpers
  
  before do
    std_before
  end
  
  def run_task
    @manifest.prepare! # this should be run first...
    super('manifest:catalog')
  end
  
  it "create an entry for each item in the target regardless of language with the relative path as filename" do
    run_task
    
    # collect filenames from target dir...
    filenames = Dir.glob(File.join(@target.source_root, '**','*'))
    filenames.reject! { |f| File.directory?(f) }
    filenames.map! { |f| f.sub(@target.source_root + '/', '') }
    filenames.reject! { |f| f =~ /^(apps|frameworks|themes)/ }
          
    entries = @manifest.entries.dup # get entries to test...
    filenames.each do |filename|
      entry = entries.find { |e| e.filename == filename }
      if entry.nil?
        nil.should == filename # oops!  not found...
      else
        entry.filename.should == filename
        entry.build_task.should == 'build:copy'
        entry.build_path.should == File.join(@manifest.build_root, filename)
        entry.staging_path.should == File.join(@manifest.source_root, filename)
        entry.source_path.should == entry.staging_path
        entry.url.should == [@manifest.url_root, filename] * '/'
        entry.should_not be_hidden
        entry.original?.should be_true # mark as original entry
      end
        
      (entry.nil? ? nil : entry.filename).should == filename
      entries.delete entry
    end
    entries.size.should == 0
  end
  
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 spec/buildtasks/manifest/catalog_spec.rb
sproutit-sproutcore-1.0.0.20090408130025 spec/buildtasks/manifest/catalog_spec.rb
sproutit-sproutcore-1.0.0.20090416161445 spec/buildtasks/manifest/catalog_spec.rb
sproutit-sproutcore-1.0.0.20090720093355 spec/buildtasks/manifest/catalog_spec.rb
sproutit-sproutcore-1.0.0.20090720202429 spec/buildtasks/manifest/catalog_spec.rb
sproutit-sproutcore-1.0.0.20090721125122 spec/buildtasks/manifest/catalog_spec.rb
sproutit-sproutcore-1.0.126 spec/buildtasks/manifest/catalog_spec.rb
sproutit-sproutcore-1.0.20090721145236 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1046 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1043 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1042 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1037 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1035 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1031 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1030 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1029 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1027 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1028 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1026 spec/buildtasks/manifest/catalog_spec.rb
sproutcore-1.0.1025 spec/buildtasks/manifest/catalog_spec.rb