aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/file/realpath_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/file/realpath_spec.rb')
-rw-r--r--spec/ruby/core/file/realpath_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/file/realpath_spec.rb b/spec/ruby/core/file/realpath_spec.rb
index 0c5d19287a..bd27e09da6 100644
--- a/spec/ruby/core/file/realpath_spec.rb
+++ b/spec/ruby/core/file/realpath_spec.rb
@@ -67,6 +67,12 @@ platform_is_not :windows do
it "raises Errno::ENOENT if the symlink points to an absent file" do
-> { File.realpath(@fake_link) }.should raise_error(Errno::ENOENT)
end
+
+ it "converts the argument with #to_path" do
+ path = mock("path")
+ path.should_receive(:to_path).and_return(__FILE__)
+ File.realpath(path).should == File.realpath(__FILE__ )
+ end
end
end