diff options
author | Jamis Buck <jamis@37signals.com> | 2005-08-30 20:53:32 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-08-30 20:53:32 +0000 |
commit | 6b1864a048ffb9343d4658ec11c32494d7f038db (patch) | |
tree | 6c1ad3f9131d644afab6cc6188001cfb73775e33 /switchtower/test/command_test.rb | |
parent | bb7f60ca1cd191fd775fef261b4d2bc7af223604 (diff) | |
download | rails-6b1864a048ffb9343d4658ec11c32494d7f038db.tar.gz rails-6b1864a048ffb9343d4658ec11c32494d7f038db.tar.bz2 rails-6b1864a048ffb9343d4658ec11c32494d7f038db.zip |
Move switchtower to the tools directory, to decouple it from rails
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2074 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'switchtower/test/command_test.rb')
-rw-r--r-- | switchtower/test/command_test.rb | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/switchtower/test/command_test.rb b/switchtower/test/command_test.rb deleted file mode 100644 index 7005ba0f2d..0000000000 --- a/switchtower/test/command_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -$:.unshift File.dirname(__FILE__) + "/../lib" - -require 'stringio' -require 'test/unit' -require 'switchtower/command' - -class CommandTest < Test::Unit::TestCase - class MockSession - def open_channel - { :closed => true, :status => 0 } - end - end - - class MockActor - attr_reader :sessions - - def initialize - @sessions = Hash.new { |h,k| h[k] = MockSession.new } - end - end - - def setup - @actor = MockActor.new - end - - def test_command_executes_on_all_servers - command = SwitchTower::Command.new(%w(server1 server2 server3), - "hello", nil, {}, @actor) - assert_equal %w(server1 server2 server3), @actor.sessions.keys.sort - end - - def test_command_with_newlines - command = SwitchTower::Command.new(%w(server1), "hello\nworld", nil, {}, - @actor) - assert_equal "hello\\\nworld", command.command - end - - def test_command_with_windows_newlines - command = SwitchTower::Command.new(%w(server1), "hello\r\nworld", nil, {}, - @actor) - assert_equal "hello\\\nworld", command.command - end -end |