Sha256: 5a29e4129b20c653a99c0c356d7ff119da87472ab5463b1afba9b0fc227ed43e

Contents?: true

Size: 883 Bytes

Versions: 5

Compression:

Stored size: 883 Bytes

Contents

require 'spec_helper'

describe 'Mina' do
  it '#invoke should work' do

    rake {
      task :clone do
        queue 'git clone'
      end
    }

    2.times {
      rake { invoke :clone }
    }

    expect(rake.commands).to eq(['git clone'])
  end

  it '#invoke should work with :reenable option' do

    rake {
      task :pull do
        queue 'git pull'
      end
    }

    2.times {
      rake { invoke :pull, :reenable => true }
    }

    expect(rake.commands).to eq(['git pull', 'git pull'])
  end

  it '#invoke with task arguments should work with :reenable option' do

    rake {
      task :hello, [:world] do |t, args|
        queue "echo Hello #{args[:world]}"
      end
    }


    %w(World Pirate).each { |name|
      rake { invoke :"hello[#{name}]", :reenable => true }
    }

    expect(rake.commands).to eq(['echo Hello World', 'echo Hello Pirate'])
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mina-0.3.8 spec/dsl/invoke_spec.rb
mina-0.3.7 spec/dsl/invoke_spec.rb
mina-0.3.6 spec/dsl/invoke_spec.rb
mina-0.3.4 spec/dsl/invoke_spec.rb
mina-0.3.3 spec/dsl/invoke_spec.rb