diff options
Diffstat (limited to 'spec/ruby/library/syslog')
| -rw-r--r-- | spec/ruby/library/syslog/close_spec.rb | 16 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/constants_spec.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/facility_spec.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/ident_spec.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/inspect_spec.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/log_spec.rb | 8 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/mask_spec.rb | 14 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/open_spec.rb | 10 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/opened_spec.rb | 16 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/options_spec.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/shared/log.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/library/syslog/shared/reopen.rb | 14 |
12 files changed, 52 insertions, 52 deletions
diff --git a/spec/ruby/library/syslog/close_spec.rb b/spec/ruby/library/syslog/close_spec.rb index 8c3b67c05b..713ef701d2 100644 --- a/spec/ruby/library/syslog/close_spec.rb +++ b/spec/ruby/library/syslog/close_spec.rb @@ -7,29 +7,29 @@ platform_is_not :windows do platform_is_not :windows 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 "closes the log" do - Syslog.opened?.should be_false + Syslog.opened?.should == false Syslog.open - Syslog.opened?.should be_true + Syslog.opened?.should == true Syslog.close - Syslog.opened?.should be_false + Syslog.opened?.should == false end it "raises a RuntimeError if the log's already closed" do - -> { Syslog.close }.should raise_error(RuntimeError) + -> { Syslog.close }.should.raise(RuntimeError) end it "it does not work inside blocks" do -> { Syslog.open { |s| s.close } - }.should raise_error(RuntimeError) + }.should.raise(RuntimeError) Syslog.should_not.opened? end @@ -37,7 +37,7 @@ platform_is_not :windows do Syslog.open("rubyspec") Syslog.ident.should == "rubyspec" Syslog.close - Syslog.ident.should be_nil + Syslog.ident.should == nil end it "sets the options to nil" do diff --git a/spec/ruby/library/syslog/constants_spec.rb b/spec/ruby/library/syslog/constants_spec.rb index fc9db47dd8..a6ac355ddd 100644 --- a/spec/ruby/library/syslog/constants_spec.rb +++ b/spec/ruby/library/syslog/constants_spec.rb @@ -17,7 +17,7 @@ platform_is_not :windows do it "includes the Syslog constants" do @constants.each do |c| - Syslog::Constants.should have_constant(c) + Syslog::Constants.should.const_defined?(c, true) end end end diff --git a/spec/ruby/library/syslog/facility_spec.rb b/spec/ruby/library/syslog/facility_spec.rb index 550ca70b11..79a685c201 100644 --- a/spec/ruby/library/syslog/facility_spec.rb +++ b/spec/ruby/library/syslog/facility_spec.rb @@ -7,11 +7,11 @@ platform_is_not :windows do platform_is_not :windows 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 "returns the logging facility" do @@ -21,7 +21,7 @@ platform_is_not :windows do end it "returns nil if the log is closed" do - Syslog.opened?.should be_false + Syslog.opened?.should == false Syslog.facility.should == nil end diff --git a/spec/ruby/library/syslog/ident_spec.rb b/spec/ruby/library/syslog/ident_spec.rb index 3b08327140..80302a42b8 100644 --- a/spec/ruby/library/syslog/ident_spec.rb +++ b/spec/ruby/library/syslog/ident_spec.rb @@ -7,11 +7,11 @@ platform_is_not :windows do platform_is_not :windows 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 "returns the logging identity" do diff --git a/spec/ruby/library/syslog/inspect_spec.rb b/spec/ruby/library/syslog/inspect_spec.rb index f45231f8e3..6407423fd3 100644 --- a/spec/ruby/library/syslog/inspect_spec.rb +++ b/spec/ruby/library/syslog/inspect_spec.rb @@ -7,11 +7,11 @@ platform_is_not :windows do platform_is_not :windows 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 "returns a string a closed log" do diff --git a/spec/ruby/library/syslog/log_spec.rb b/spec/ruby/library/syslog/log_spec.rb index 0c855b8257..1650283371 100644 --- a/spec/ruby/library/syslog/log_spec.rb +++ b/spec/ruby/library/syslog/log_spec.rb @@ -7,11 +7,11 @@ platform_is_not :windows 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 "receives a priority as first argument" do @@ -34,14 +34,14 @@ platform_is_not :windows do it "fails with TypeError on nil log messages" do Syslog.open do |s| - -> { s.log(1, nil) }.should raise_error(TypeError) + -> { s.log(1, nil) }.should.raise(TypeError) end end it "fails if the log is closed" do -> { Syslog.log(Syslog::LOG_ALERT, "test") - }.should raise_error(RuntimeError) + }.should.raise(RuntimeError) end it "accepts printf parameters" do diff --git a/spec/ruby/library/syslog/mask_spec.rb b/spec/ruby/library/syslog/mask_spec.rb index b3f1250b24..23cca6fa8d 100644 --- a/spec/ruby/library/syslog/mask_spec.rb +++ b/spec/ruby/library/syslog/mask_spec.rb @@ -7,11 +7,11 @@ platform_is_not :windows do platform_is_not :windows 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 # make sure we return the mask to the default value Syslog.open { |s| s.mask = 255 } end @@ -74,11 +74,11 @@ platform_is_not :windows do platform_is_not :windows 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 # make sure we return the mask to the default value Syslog.open { |s| s.mask = 255 } end @@ -91,7 +91,7 @@ platform_is_not :windows do end it "raises an error if the log is closed" do - -> { Syslog.mask = 1337 }.should raise_error(RuntimeError) + -> { Syslog.mask = 1337 }.should.raise(RuntimeError) end it "only accepts numbers" do @@ -103,8 +103,8 @@ platform_is_not :windows do Syslog.mask = 3.1416 Syslog.mask.should == 3 - -> { Syslog.mask = "oh hai" }.should raise_error(TypeError) - -> { Syslog.mask = "43" }.should raise_error(TypeError) + -> { Syslog.mask = "oh hai" }.should.raise(TypeError) + -> { Syslog.mask = "43" }.should.raise(TypeError) end end diff --git a/spec/ruby/library/syslog/open_spec.rb b/spec/ruby/library/syslog/open_spec.rb index 543f5d418b..73e3780d78 100644 --- a/spec/ruby/library/syslog/open_spec.rb +++ b/spec/ruby/library/syslog/open_spec.rb @@ -8,11 +8,11 @@ platform_is_not :windows do platform_is_not :windows 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 "returns the module" do @@ -69,18 +69,18 @@ platform_is_not :windows do it "closes the log if after it receives a block" do Syslog.open{ } - Syslog.opened?.should be_false + Syslog.opened?.should == false end it "raises an error if the log is opened" do Syslog.open -> { Syslog.open - }.should raise_error(RuntimeError, /syslog already open/) + }.should.raise(RuntimeError, /syslog already open/) -> { Syslog.close Syslog.open - }.should_not raise_error + }.should_not.raise Syslog.close end end diff --git a/spec/ruby/library/syslog/opened_spec.rb b/spec/ruby/library/syslog/opened_spec.rb index 94432e65a4..ad4311d15a 100644 --- a/spec/ruby/library/syslog/opened_spec.rb +++ b/spec/ruby/library/syslog/opened_spec.rb @@ -7,32 +7,32 @@ platform_is_not :windows do platform_is_not :windows 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 "returns true if the log is opened" do Syslog.open - Syslog.opened?.should be_true + Syslog.opened?.should == true Syslog.close end it "returns false otherwise" do - Syslog.opened?.should be_false + Syslog.opened?.should == false Syslog.open Syslog.close - Syslog.opened?.should be_false + Syslog.opened?.should == false end it "works inside a block" do Syslog.open do |s| - s.opened?.should be_true - Syslog.opened?.should be_true + s.opened?.should == true + Syslog.opened?.should == true end - Syslog.opened?.should be_false + Syslog.opened?.should == false end end end diff --git a/spec/ruby/library/syslog/options_spec.rb b/spec/ruby/library/syslog/options_spec.rb index 83ba43503e..2035272f70 100644 --- a/spec/ruby/library/syslog/options_spec.rb +++ b/spec/ruby/library/syslog/options_spec.rb @@ -7,11 +7,11 @@ platform_is_not :windows do platform_is_not :windows 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 "returns the logging options" do @@ -21,7 +21,7 @@ platform_is_not :windows do end it "returns nil when the log is closed" do - Syslog.opened?.should be_false + Syslog.opened?.should == false Syslog.options.should == nil end diff --git a/spec/ruby/library/syslog/shared/log.rb b/spec/ruby/library/syslog/shared/log.rb index 9f9302b214..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, :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 diff --git a/spec/ruby/library/syslog/shared/reopen.rb b/spec/ruby/library/syslog/shared/reopen.rb index 621437a01d..f04408e807 100644 --- a/spec/ruby/library/syslog/shared/reopen.rb +++ b/spec/ruby/library/syslog/shared/reopen.rb @@ -1,22 +1,22 @@ describe :syslog_reopen, shared: true do platform_is_not :windows 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 "reopens the log" do Syslog.open - -> { Syslog.send(@method)}.should_not raise_error - Syslog.opened?.should be_true + -> { Syslog.send(@method)}.should_not.raise + Syslog.opened?.should == true Syslog.close end it "fails with RuntimeError if the log is closed" do - -> { Syslog.send(@method)}.should raise_error(RuntimeError) + -> { Syslog.send(@method)}.should.raise(RuntimeError) end it "receives the same parameters as Syslog.open" do @@ -26,9 +26,9 @@ describe :syslog_reopen, shared: true do s.ident.should == "rubyspec" s.options.should == 3 s.facility.should == Syslog::LOG_USER - s.opened?.should be_true + s.opened?.should == true end - Syslog.opened?.should be_false + Syslog.opened?.should == false end it "returns the module" do |
