Sha256: 221078e5860ed543d6b0aec430a72ef490ea38c99178adae2ae4b832f2a42b4a
Contents?: true
Size: 1.52 KB
Versions: 3
Compression:
Stored size: 1.52 KB
Contents
######################################################################### # test_win32_daemon.rb # # Test suite for the Win32::Daemon class. You should run this test via # the 'rake test' or 'rake test_daemon' tasks. # # These tests are rather limited, since the acid test is to install # your daemon as a service and see how it behaves. ######################################################################### require 'test-unit' require 'win32/daemon' include Win32 class TC_Daemon < Test::Unit::TestCase def setup @daemon = Daemon.new end test "version number is set properly" do assert_equal('0.8.4', Daemon::VERSION) end test "constructor basic functionality" do assert_respond_to(Daemon, :new) assert_nothing_raised{ Daemon.new } end test "constructor does not accept any arguments" do assert_raises(ArgumentError){ Daemon.new(1) } end test "mainloop basic functionality" do assert_respond_to(@daemon, :mainloop) end test "state basic functionality" do assert_respond_to(@daemon, :state) end test "is_running basic functionality" do assert_respond_to(@daemon, :running?) end test "expected constants are defined" do assert_not_nil(Daemon::CONTINUE_PENDING) assert_not_nil(Daemon::PAUSE_PENDING) assert_not_nil(Daemon::PAUSED) assert_not_nil(Daemon::RUNNING) assert_not_nil(Daemon::START_PENDING) assert_not_nil(Daemon::STOP_PENDING) assert_not_nil(Daemon::STOPPED) assert_not_nil(Daemon::IDLE) end def teardown @daemon = nil end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
win32-service-0.8.6 | test/test_win32_daemon.rb |
win32-service-0.8.5 | test/test_win32_daemon.rb |
win32-service-0.8.4 | test/test_win32_daemon.rb |