summaryrefslogtreecommitdiff
path: root/spec/ruby/library/logger/device
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/logger/device')
-rw-r--r--spec/ruby/library/logger/device/close_spec.rb6
-rw-r--r--spec/ruby/library/logger/device/new_spec.rb18
-rw-r--r--spec/ruby/library/logger/device/write_spec.rb6
3 files changed, 15 insertions, 15 deletions
diff --git a/spec/ruby/library/logger/device/close_spec.rb b/spec/ruby/library/logger/device/close_spec.rb
index 777b20baf0..1db5d582a7 100644
--- a/spec/ruby/library/logger/device/close_spec.rb
+++ b/spec/ruby/library/logger/device/close_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/common', __FILE__)
+require_relative '../../../spec_helper'
+require_relative '../fixtures/common'
describe "Logger::LogDevice#close" do
before :each do
@@ -17,6 +17,6 @@ describe "Logger::LogDevice#close" do
it "closes the LogDevice's stream" do
@device.close
- lambda { @device.write("Test") }.should complain(/\Alog writing failed\./)
+ -> { @device.write("Test") }.should complain(/\Alog shifting failed\./)
end
end
diff --git a/spec/ruby/library/logger/device/new_spec.rb b/spec/ruby/library/logger/device/new_spec.rb
index 0e08b743ed..c943e7fbe2 100644
--- a/spec/ruby/library/logger/device/new_spec.rb
+++ b/spec/ruby/library/logger/device/new_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/common', __FILE__)
+require_relative '../../../spec_helper'
+require_relative '../fixtures/common'
describe "Logger::LogDevice#new" do
before :each do
@@ -14,11 +14,11 @@ describe "Logger::LogDevice#new" do
it "creates a new log device" do
l = Logger::LogDevice.new(@log_file)
- l.dev.should be_kind_of(File)
+ l.dev.should.is_a?(File)
end
it "receives an IO object to log there as first argument" do
- @log_file.should be_kind_of(IO)
+ @log_file.should.is_a?(IO)
l = Logger::LogDevice.new(@log_file)
l.write("foo")
@log_file.rewind
@@ -31,17 +31,17 @@ describe "Logger::LogDevice#new" do
l.write("Test message")
l.close
- File.exist?(path).should be_true
+ File.should.exist?(path)
File.open(path) do |f|
- f.readlines.should_not be_empty
+ f.readlines.should_not.empty?
end
rm_r path
end
it "receives options via a hash as second argument" do
- lambda { Logger::LogDevice.new(STDERR,
- { shift_age: 8, shift_size: 10
- })}.should_not raise_error
+ -> {
+ Logger::LogDevice.new(STDERR, shift_age: 8, shift_size: 10)
+ }.should_not.raise
end
end
diff --git a/spec/ruby/library/logger/device/write_spec.rb b/spec/ruby/library/logger/device/write_spec.rb
index e3ddd61b1f..87ecf2ad6a 100644
--- a/spec/ruby/library/logger/device/write_spec.rb
+++ b/spec/ruby/library/logger/device/write_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../../fixtures/common', __FILE__)
+require_relative '../../../spec_helper'
+require_relative '../fixtures/common'
describe "Logger::LogDevice#write" do
before :each do
@@ -37,6 +37,6 @@ describe "Logger::LogDevice#write" do
it "fails if the device is already closed" do
@device.close
- lambda { @device.write "foo" }.should complain(/\Alog writing failed\./)
+ -> { @device.write "foo" }.should complain(/\Alog shifting failed\./)
end
end