aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/file/extname_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/file/extname_spec.rb')
-rw-r--r--spec/ruby/core/file/extname_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/file/extname_spec.rb b/spec/ruby/core/file/extname_spec.rb
index e9b53bc24d..e182ed44f2 100644
--- a/spec/ruby/core/file/extname_spec.rb
+++ b/spec/ruby/core/file/extname_spec.rb
@@ -12,6 +12,16 @@ describe "File.extname" do
File.extname(".app.conf").should == ".conf"
end
+ it "returns unfrozen strings" do
+ File.extname("foo.rb").frozen?.should == false
+ File.extname("/foo/bar.rb").frozen?.should == false
+ File.extname("/foo.rb/bar.c").frozen?.should == false
+ File.extname("bar").frozen?.should == false
+ File.extname(".bashrc").frozen?.should == false
+ File.extname("/foo.bar/baz").frozen?.should == false
+ File.extname(".app.conf").frozen?.should == false
+ end
+
it "returns the extension for edge cases" do
File.extname("").should == ""
File.extname(".").should == ""