Sha256: 2a8c9532b17831016e1d8c2f105bfb59c2981a4cb95270c65707a76084c6a5af

Contents?: true

Size: 855 Bytes

Versions: 20

Compression:

Stored size: 855 Bytes

Contents

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

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

  it "should add a new task to the buildfile" do
    b = SC::Buildfile.define do
      task :task1 
    end
    b.task_defined?(:task1).should_not be_nil
  end
  
  it "should add a new task with a dependency if specified" do
    b = SC::Buildfile.define do
      task :task1 => :task2
    end
    b.lookup(:task1).prerequisites.first.should eql('task2')
  end
  
  it "extend an existing task by adding the second action if defined" do
    results = {}
    b = SC::Buildfile.define do
      task :task1 do
        RESULTS[:foo] = true
      end
      
      task :task1 do
        RESULTS[:bar] = true
      end
    end
    
    b.invoke :task1, :results => results
    results[:foo].should be_true
    results[:bar].should be_true
  end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 spec/lib/buildfile_commands/task_spec.rb
sproutit-sproutcore-1.0.0.20090408130025 spec/lib/buildfile_commands/task_spec.rb
sproutit-sproutcore-1.0.0.20090416161445 spec/lib/buildfile_commands/task_spec.rb
sproutit-sproutcore-1.0.20090721145236 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1046 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1043 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1042 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1037 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1035 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1031 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1030 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1029 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1027 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1028 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1026 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1025 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1024 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1009 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1008 spec/lib/buildfile_commands/task_spec.rb
sproutcore-1.0.1003 spec/lib/buildfile_commands/task_spec.rb