Sha256: 91f618a716ab51c6086464f210dd589e0b1b4bb1befe250c6fdb6ab4fb5b34c1

Contents?: true

Size: 602 Bytes

Versions: 65

Compression:

Stored size: 602 Bytes

Contents

require "spec_helper"

describe SC::Buildfile::Commands, 'task' do

  it "should add a new task to the buildfile" do
    b = SC::Buildfile.define do
      replace_task :task1
    end
    b.task_defined?(:task1).should_not be_nil
  end

  it "should replace an existing task completely if defined" do
    results = {}
    b = SC::Buildfile.define do
      task :task1 do
        RESULTS[:foo] = :original
      end

      replace_task :task1 do |task, env|
        RESULTS[:foo] = :replaced
      end
    end

    b.invoke :task1, :results => results

    results[:foo].should eql(:replaced)
  end

end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
sproutcore-1.6.0.1 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.1-x86-mingw32 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0-java spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.rc.2-x86-mingw32 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.rc.2 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.rc.2-java spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.rc.1-x86-mingw32 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.rc.1 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.rc.1-java spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.beta.3-x86-mingw32 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.beta.3-java spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.beta.3 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.beta.2-x86-mingw32 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.beta.2-java spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.beta.2 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.6.0.beta.1 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.5.0-java spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.5.0 spec/lib/buildfile_commands/replace_task_spec.rb
sproutcore-1.5.0.rc.2 spec/lib/buildfile_commands/replace_task_spec.rb