Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 9025 for tools

Show
Ignore:
Timestamp:
03/14/08 03:20:08 (7 months ago)
Author:
minam
Message:

Ensure that the default run options are mixed into the command options when executing a command from the cap shell (closes #11348)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/capistrano/CHANGELOG

    r8995 r9025  
    11*SVN* 
     2 
     3* Ensure that the default run options are mixed into the command options when executing a command from the cap shell [Ken Collins] 
    24 
    35* Added :none SCM module for deploying a specific directory's contents [Jamis Buck] 
  • tools/capistrano/lib/capistrano/shell.rb

    r7696 r9025  
    170170        processor = configuration.sudo_behavior_callback(Configuration.default_io_proc) 
    171171        sessions = servers.map { |server| configuration.sessions[server] } 
    172         cmd = Command.new(command, sessions, :logger => configuration.logger, &processor) 
     172        options = configuration.add_default_command_options({}) 
     173        cmd = Command.new(command, sessions, options.merge(:logger => configuration.logger), &processor) 
    173174        previous = trap("INT") { cmd.stop! } 
    174175        cmd.process! 
  • tools/capistrano/test/shell_test.rb

    r6457 r9025  
    6262    assert @shell.read_and_execute 
    6363  end 
     64   
     65  def test_task_command_with_bang_gets_processed_by_exec_tasks 
     66    while_testing_post_exec_commands do 
     67      @shell.expects(:read_line).returns("!deploy") 
     68      @shell.expects(:exec_tasks).with(["deploy"]) 
     69      assert @shell.read_and_execute 
     70    end 
     71  end 
     72   
     73  def test_normal_command_gets_processed_by_exec_command 
     74    while_testing_post_exec_commands do 
     75      @shell.expects(:read_line).returns("uptime") 
     76      @shell.expects(:exec_command).with("uptime",nil) 
     77      @shell.expects(:connect) 
     78      assert @shell.read_and_execute 
     79    end 
     80  end 
     81   
     82   
     83  private 
     84   
     85  def while_testing_post_exec_commands(&block) 
     86    @shell.instance_variable_set(:@mutex,Mutex.new) 
     87    yield 
     88  end 
     89   
    6490end