diff options
Diffstat (limited to 'spec/ruby/core/file/stat_spec.rb')
| -rw-r--r-- | spec/ruby/core/file/stat_spec.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/ruby/core/file/stat_spec.rb b/spec/ruby/core/file/stat_spec.rb index 76b0becbf0..d5238b6331 100644 --- a/spec/ruby/core/file/stat_spec.rb +++ b/spec/ruby/core/file/stat_spec.rb @@ -23,14 +23,14 @@ platform_is_not :windows do st = f.stat - st.file?.should == true - st.zero?.should == false + st.should.file? + st.should_not.zero? st.size.should == 8 st.size?.should == 8 st.blksize.should >= 0 - st.atime.should be_kind_of(Time) - st.ctime.should be_kind_of(Time) - st.mtime.should be_kind_of(Time) + st.atime.should.is_a?(Time) + st.ctime.should.is_a?(Time) + st.mtime.should.is_a?(Time) end end @@ -38,16 +38,17 @@ platform_is_not :windows do File.symlink(@file, @link) st = File.stat(@link) - st.file?.should == true - st.symlink?.should == false + st.should.file? + st.should_not.symlink? end it "returns an error when given missing non-ASCII path" do - missing_path = "/missingfilepath\xE3E4".force_encoding("ASCII-8BIT") + missing_path = "/missingfilepath\xE3E4".b -> { File.stat(missing_path) - }.should raise_error(Errno::ENOENT) { |e| - e.message.should include(missing_path) + }.should.raise(SystemCallError) { |e| + [Errno::ENOENT, Errno::EILSEQ].should.include?(e.class) + e.message.should.include?(missing_path) } end end |
