schlueter / rushmate

Creates a bridge between rush ruby shell + ssh and textmate your favorite text editor

This URL has Read+Write access

rushmate / test / command_test.rb
100644 49 lines (40 sloc) 1.114 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require File.dirname(__FILE__) + "/helper"
 
class CommandText < Test::Unit::TestCase
  def setup
    
  end
  
  def test_shell
    rush_shell = Rushmate::Command.new.shell
    assert_not_nil rush_shell
    assert rush_shell.is_a?(Rush::Shell)
  end
  
  def test_execute
    rush_output = Rushmate::Command.new.execute("root")
    assert_not_nil(rush_output)
    assert rush_output.is_a?(Rush::Dir)
  end
  
  def test_method_missing
    rush_output = Rushmate::Command.new.root
    assert_not_nil(rush_output)
    assert rush_output.is_a?(Rush::Dir)
  end
  
  def test_exit
    exit = Rushmate::Command.new.exit
    assert_not_nil(exit)
    assert_equal(Rushmate::Exit, exit)
  end
  
  def test_user_input
    user_input = Rushmate::Command.new.user_input
    assert_not_nil(user_input)
    assert_equal(Rushmate::UserInput, user_input)
  end
  
  def test_initialize_should_call_block
    assert_nil($last_res)
    Rushmate::Command.new {
      root
    }
    assert_not_nil($last_res)
  end
  
  def test_should_mixin_textmate_helper
    assert Rushmate::Command.new.respond_to?(:project_directory)
  end
end