We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd772b8 commit a747f3cCopy full SHA for a747f3c
1 file changed
core/file/dirname_spec.rb
@@ -78,12 +78,14 @@ def object.to_int; 2; end
78
File.dirname("foo/../").should == "foo"
79
end
80
81
- it "rejects strings encoded with non ASCII-compatible encodings" do
82
- Encoding.list.reject(&:ascii_compatible?).reject(&:dummy?).each do |enc|
83
- path = "/foo/bar".encode(enc)
84
- -> {
85
- File.dirname(path)
86
- }.should raise_error(Encoding::CompatibilityError)
+ ruby_version_is "3.3" do # Ruby 3.2 has Encoding#replicate which can break this
+ it "rejects strings encoded with non ASCII-compatible encodings" do
+ Encoding.list.reject(&:ascii_compatible?).reject(&:dummy?).each do |enc|
+ path = "/foo/bar".encode(enc)
+ -> {
+ File.dirname(path)
87
+ }.should raise_error(Encoding::CompatibilityError)
88
+ end
89
90
91
0 commit comments