Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syslog test fixes #4

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions test/test_syslog.rb
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