Sha256: 251d8578bf5607f577f3b2bc547116d9d03e0db194091696898fd1db8855e5d9

Contents?: true

Size: 960 Bytes

Versions: 18

Compression:

Stored size: 960 Bytes

Contents

# encoding: utf-8

require_relative "../spec_helper"
require "nake/dsl"

describe "Object#task" do
  before(:each) do
    Nake::Task.tasks.clear
  end

  it "should take name as a first argument" do
    task(:name).name.should eql(:name)
  end

  it "should optinally take other arguments as a dependencies" do
    task(:release, :build, :tag).dependencies.should eql([:build, :tag])
  end

  it "should optinally take a block as a task definition" do
    task = task(:release) { "released!" }
    task.should have(1).blocks
  end

  it "should be able to add a dependencies to the task definition" do
    task(:release, :build)
    task(:release, :tag)
    task(:release).dependencies.should eql([:build, :tag])
  end

  it "should be able to add a block to the task definition" do
    task = task(:release) { "first block" }
    task(:release) { "second block" }
    -> { task(:release) { "released!" } }.should change { task.blocks.length }.by(1)
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
nake-0.1.1 spec/nake/dsl_spec.rb
nake-0.1 spec/nake/dsl_spec.rb
nake-0.0.9.5 spec/nake/dsl_spec.rb
nake-0.0.9.4 spec/nake/dsl_spec.rb
nake-0.0.9.3 spec/nake/dsl_spec.rb
nake-0.0.9.2 spec/nake/dsl_spec.rb
nake-0.0.9.pre spec/nake/dsl_spec.rb
do_riak-0.10.1.pre gems/gems/nake-0.0.8/spec/nake/dsl_spec.rb
nake-0.0.8.pre spec/nake/dsl_spec.rb
nake-0.0.8 spec/nake/dsl_spec.rb
nake-0.0.7 spec/nake/dsl_spec.rb
nake-0.0.6 spec/nake/dsl_spec.rb
nake-0.0.5 spec/nake/dsl_spec.rb
nake-0.0.3 spec/nake/dsl_spec.rb
nake-0.0.3.pre spec/nake/dsl_spec.rb
nake-0.0.2 spec/nake/dsl_spec.rb
nake-0.0.2.pre spec/nake/dsl_spec.rb
nake-0.0.1 spec/nake/dsl_spec.rb