summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/stat_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/io/stat_spec.rb')
-rw-r--r--spec/ruby/core/io/stat_spec.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/ruby/core/io/stat_spec.rb b/spec/ruby/core/io/stat_spec.rb
index d59535843a..f9fc232ee0 100644
--- a/spec/ruby/core/io/stat_spec.rb
+++ b/spec/ruby/core/io/stat_spec.rb
@@ -1,9 +1,10 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/classes', __FILE__)
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
describe "IO#stat" do
before :each do
- @io = IO.popen 'cat', "r+"
+ cmd = platform_is(:windows) ? 'rem' : 'cat'
+ @io = IO.popen cmd, "r+"
end
after :each do
@@ -11,14 +12,14 @@ describe "IO#stat" do
end
it "raises IOError on closed stream" do
- lambda { IOSpecs.closed_io.stat }.should raise_error(IOError)
+ -> { IOSpecs.closed_io.stat }.should.raise(IOError)
end
it "returns a File::Stat object for the stream" do
- STDOUT.stat.should be_an_instance_of(File::Stat)
+ STDOUT.stat.should.instance_of?(File::Stat)
end
it "can stat pipes" do
- @io.stat.should be_an_instance_of(File::Stat)
+ @io.stat.should.instance_of?(File::Stat)
end
end