Sha256: ef883b5b5f0e2b9781e8a2ed8071e209396281973b6de311ea19255a9df9a385

Contents?: true

Size: 642 Bytes

Versions: 5

Compression:

Stored size: 642 Bytes

Contents

require 'capistrano'

class CapistranoStub
  include Capistrano::Configuration::Namespaces
  include Capistrano::Configuration::Execution
  attr_accessor :task, :ran
  
  def logger
    Logger.new(STDOUT)
  end
  
  def find_task(*args)
    @task ||= Capistrano::TaskDefinition.new("deploy", top, {}) { raise "This shouldn't be raised" }
  end
  
  def original_find_and_execute_task(*args)
    find_task.body.call
  end
  
  def namespaces
    {:default => top}
  end
  
  def tasks
    @tasks = {"deploy" => find_task}
  end
  
  def current_task
    find_task
  end
  
  def [](key)
    "admin"
  end
  
  def run
    @ran = true
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
chrismetcalf-cap-ext-webistrano-0.1.2 test/capistrano_stub.rb
mattmatt-cap-ext-webistrano-0.1.1 test/capistrano_stub.rb
mattmatt-cap-ext-webistrano-0.1.2 test/capistrano_stub.rb
mattmatt-cap-ext-webistrano-0.1.4 test/capistrano_stub.rb
cap-ext-webistrano-0.1.4 test/capistrano_stub.rb