mirror of
https://github.com/nishiki/is_master.git
synced 2025-02-18 13:00:04 +00:00
14 lines
296 B
Ruby
14 lines
296 B
Ruby
|
require 'test/unit'
|
||
|
|
||
|
class TestCli < Test::Unit::TestCase
|
||
|
def test_slave_mode
|
||
|
output = %x(is_master 10.255.255.0 echo 'GOOD!')
|
||
|
assert_match('I am slave', output)
|
||
|
end
|
||
|
|
||
|
def test_master_mode
|
||
|
output = %x(is_master 127.0.0.1 echo 'GOOD!')
|
||
|
assert_match('GOOD!', output)
|
||
|
end
|
||
|
end
|