summaryrefslogtreecommitdiff
path: root/spec/ruby/library/syslog/shared/log.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/syslog/shared/log.rb')
-rw-r--r--spec/ruby/library/syslog/shared/log.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/ruby/library/syslog/shared/log.rb b/spec/ruby/library/syslog/shared/log.rb
index b19c2eae0d..98ce4f54b2 100644
--- a/spec/ruby/library/syslog/shared/log.rb
+++ b/spec/ruby/library/syslog/shared/log.rb
@@ -1,11 +1,11 @@
describe :syslog_log, shared: true do
- platform_is_not :windows, :darwin, :solaris, :aix do
+ platform_is_not :windows, :darwin, :aix, :android do
before :each do
- Syslog.opened?.should be_false
+ Syslog.opened?.should == false
end
after :each do
- Syslog.opened?.should be_false
+ Syslog.opened?.should == false
end
it "logs a message" do
@@ -13,7 +13,7 @@ describe :syslog_log, shared: true do
Syslog.open("rubyspec", Syslog::LOG_PERROR) do
Syslog.send(@method, "Hello")
end
- }.should output_to_fd("rubyspec: Hello\n", $stderr)
+ }.should output_to_fd(/\Arubyspec(?::| \d+ - -) Hello\n\z/, $stderr)
end
it "accepts sprintf arguments" do
@@ -22,19 +22,18 @@ describe :syslog_log, shared: true do
Syslog.send(@method, "Hello %s", "world")
Syslog.send(@method, "%d dogs", 2)
end
- }.should output_to_fd("rubyspec: Hello world\nrubyspec: 2 dogs\n", $stderr)
+ }.should output_to_fd(/\Arubyspec(?::| \d+ - -) Hello world\nrubyspec(?::| \d+ - -) 2 dogs\n\z/, $stderr)
end
it "works as an alias for Syslog.log" do
level = Syslog.const_get "LOG_#{@method.to_s.upcase}"
- response = "rubyspec: Hello\n"
-> {
Syslog.open("rubyspec", Syslog::LOG_PERROR) do
Syslog.send(@method, "Hello")
Syslog.log(level, "Hello")
end
# make sure the same thing is written to $stderr.
- }.should output_to_fd(response * 2, $stderr)
+ }.should output_to_fd(/\A(?:rubyspec(?::| \d+ - -) Hello\n){2}\z/, $stderr)
end
end
end