Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions test/test_syslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ def test_open
Syslog.close

# given parameters
Syslog.open("foo", Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog::LOG_DAEMON)
options = Syslog::LOG_NDELAY | Syslog::LOG_PID
Syslog.open("foo", options, Syslog::LOG_DAEMON)

assert_equal('foo', Syslog.ident)
assert_equal(Syslog::LOG_NDELAY | Syslog::LOG_PERROR, Syslog.options)
assert_equal(options, Syslog.options)
assert_equal(Syslog::LOG_DAEMON, Syslog.facility)

Syslog.close
Expand Down Expand Up @@ -134,8 +135,9 @@ def test_log
stderr[1].close
Process.waitpid(pid)

# LOG_PERROR is not yet implemented on Cygwin.
return if RUBY_PLATFORM =~ /cygwin/
# LOG_PERROR is not implemented on Cygwin or Solaris. Only test
# these on systems that define it.
return unless Syslog.const_defined?(:LOG_PERROR)

2.times {
assert_equal("syslog_test: test1 - hello, world!\n", stderr[0].gets)
Expand Down