Sha256: 5ece600942434815d64107b4e3311ea80f9b7a7c301f92fdfb6cae4c2b641967

Contents?: true

Size: 1002 Bytes

Versions: 11

Compression:

Stored size: 1002 Bytes

Contents

require 'spec_helper'

describe 'Mina' do
  it '#invoke should work' do
    rake {
      task :hello do
        @hello = 'world'
      end
      invoke :hello
    }
    rake.instance_variable_get(:@hello).should == 'world'
  end

  it '#queue should work' do
    rake {
      queue 'sudo service nginx restart'
    }

    rake.commands.should == ['sudo service nginx restart']
  end

  it '#queue should work with multiple commands' do
    rake {
      queue 'echo Restarting'
      queue 'sudo service nginx restart'
    }

    rake.commands.should == ['echo Restarting', 'sudo service nginx restart']
  end

  it '#queue should work inside tasks' do
    rake {
      task :restart do
        queue 'echo Restarting'
        invoke :'passenger:restart'
      end

      namespace :passenger do
        task :restart do
          queue 'touch tmp/restart.txt'
        end
      end
    }

    rake { invoke :restart }

    rake.commands.should == ['echo Restarting', 'touch tmp/restart.txt']
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
mina-traackr-0.3.0 spec/dsl/queue_spec.rb
mina-0.3.0 spec/dsl/queue_spec.rb
mina-0.2.1 spec/dsl/queue_spec.rb
mina-0.2.0 spec/dsl/queue_spec.rb
mina-0.2.0.pre2 spec/dsl/queue_spec.rb
mina-0.1.3.pre1 spec/dsl/queue_spec.rb
mina-0.1.2 spec/dsl/queue_spec.rb
mina-0.1.2.pre2 spec/dsl/queue_spec.rb
mina-0.1.2.pre1 spec/dsl/queue_spec.rb
mina-0.1.1 spec/dsl/queue_spec.rb
mina-0.1.0 spec/dsl/queue_spec.rb