Sha256: 5a1e6ae5ac18f468ee79eb72516933007da8197a7e1118184255b03fcaab2d38

Contents?: true

Size: 996 Bytes

Versions: 4

Compression:

Stored size: 996 Bytes

Contents

describe :syslog_reopen, :shared => true do
  platform_is_not :windows do
    before :each do
      Syslog.opened?.should be_false
    end

    after :each do
      Syslog.opened?.should be_false
    end

    it "reopens the log" do
      Syslog.open
      lambda { Syslog.send(@method)}.should_not raise_error
      Syslog.opened?.should be_true
      Syslog.close
    end

    it "fails with RuntimeError if the log is closed" do
      lambda { Syslog.send(@method)}.should raise_error(RuntimeError)
    end

    it "receives the same parameters as Syslog.open" do
      Syslog.open
      Syslog.send(@method, "rubyspec", 3, 8) do |s|
        s.should == Syslog
        s.ident.should == "rubyspec"
        s.options.should == 3
        s.facility.should == Syslog::LOG_USER
        s.opened?.should be_true
      end
      Syslog.opened?.should be_false
    end

    it "returns the module" do
      Syslog.open
      Syslog.send(@method).should == Syslog
      Syslog.close
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubysl-syslog-3.0 spec/shared/reopen.rb
rubysl-syslog-2.1.0 spec/shared/reopen.rb
rubysl-syslog-1.0.0 spec/shared/reopen.rb
rubysl-syslog-2.0.1 spec/shared/reopen.rb