summaryrefslogtreecommitdiff
path: root/spec/ruby/core/file/shared
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-10-24 15:52:37 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-10-24 15:53:53 +0200
commit148961adcd0704d964fce920330a6301b9704c25 (patch)
tree1f1f0cb7326775788683c77f0e2cceb495d3cc95 /spec/ruby/core/file/shared
parent342fbae83c2e80d1b49656bc7c689cc7fe8980ce (diff)
Update to ruby/spec@4f59d86
Diffstat (limited to 'spec/ruby/core/file/shared')
-rw-r--r--spec/ruby/core/file/shared/path.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/ruby/core/file/shared/path.rb b/spec/ruby/core/file/shared/path.rb
index d964acc855..0a5abe33f0 100644
--- a/spec/ruby/core/file/shared/path.rb
+++ b/spec/ruby/core/file/shared/path.rb
@@ -15,6 +15,23 @@ describe :file_path, shared: true do
@file.send(@method).should be_an_instance_of(String)
end
+ it "returns a different String on every call" do
+ @file = File.new @path
+ path1 = @file.send(@method)
+ path2 = @file.send(@method)
+ path1.should == path2
+ path1.should_not.equal?(path2)
+ end
+
+ it "returns a mutable String" do
+ @file = File.new @path.dup.freeze
+ path = @file.send(@method)
+ path.should == @path
+ path.should_not.frozen?
+ path << "test"
+ @file.send(@method).should == @path
+ end
+
it "calls to_str on argument and returns exact value" do
path = mock('path')
path.should_receive(:to_str).and_return(@path)