diff options
Diffstat (limited to 'spec/ruby/library/logger/device/new_spec.rb')
| -rw-r--r-- | spec/ruby/library/logger/device/new_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
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 |
