summaryrefslogtreecommitdiff
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, 8 insertions, 2 deletions
diff --git a/spec/ruby/core/file/extname_spec.rb b/spec/ruby/core/file/extname_spec.rb
index 358690b44a..3b7fa5a128 100644
--- a/spec/ruby/core/file/extname_spec.rb
+++ b/spec/ruby/core/file/extname_spec.rb
@@ -20,8 +20,14 @@ describe "File.extname" do
File.extname("..").should == ""
File.extname("...").should == ""
File.extname("....").should == ""
- File.extname(".foo.").should == ""
- File.extname("foo.").should == ""
+ guard -> { platform_is :windows or ruby_version_is ""..."2.7" } do
+ File.extname(".foo.").should == ""
+ File.extname("foo.").should == ""
+ end
+ guard -> { platform_is_not :windows and ruby_version_is "2.7" } do
+ File.extname(".foo.").should == "."
+ File.extname("foo.").should == "."
+ end
end
it "returns only the last extension of a file with several dots" do