Sha256: 2995b8edfa9a6939ed3a191e8665f352b1b27c3ae5cb9919632cde6b8e69d22c

Contents?: true

Size: 1.02 KB

Versions: 16

Compression:

Stored size: 1.02 KB

Contents

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

module SC::ManifestSpecHelpers

  def std_before(project_name = :real_world, target_name = :sproutcore)
    @project = fixture_project project_name
    @target = @project.target_for target_name
    @buildfile = @target.buildfile
    @config = @target.config
    @manifest = @target.manifest_for(:language => :fr)
    
    @target.prepare! # make sure its ready for the manifest...
  end

  def run_task(task_name)
    @buildfile.invoke task_name,
      :manifest => @manifest,
      :target =>   @target, 
      :project =>  @project, 
      :config =>   @config
  end

  def entry_for(filename, opts={})
    @manifest.entry_for(filename, opts) || @manifest.entry_for(filename, opts.merge(:hidden => true))
  end
  
  # Verifies that the named task runs when the passed block is executed
  def should_run(task_name, &block)
    task = @buildfile.lookup(task_name)
    first_count = task.invoke_count
    yield if block_given?
    task.invoke_count.should > first_count
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
sproutcore-1.0.1046 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1043 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1042 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1037 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1035 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1031 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1030 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1029 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1027 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1028 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1026 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1025 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1024 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1009 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1008 spec/buildtasks/manifest/spec_helper.rb
sproutcore-1.0.1003 spec/buildtasks/manifest/spec_helper.rb