|
4 | 4 | describe Resque::Pool::Logging do |
5 | 5 |
|
6 | 6 | let(:expect_flags) { File::WRONLY | File::APPEND } |
7 | | - |
8 | 7 |
|
9 | 8 | # Don't pollute the log output |
10 | 9 | before(:all) { $skip_logging = true } |
|
47 | 46 | expect(File.exist?(tmp_path)).to be_truthy |
48 | 47 | expect(@before).to_not eq(File.stat(tmp_path).inspect) |
49 | 48 | expect(@fp.stat.inspect).to eq(File.stat(tmp_path).inspect) |
50 | | - pending("ruby 3.4 reopen resets the encoding to nil!") if "3.4.0" <= RUBY_VERSION |
51 | | - expect(@ext).to eq((@fp.external_encoding rescue nil)) |
52 | | - expect(@int).to eq((@fp.internal_encoding rescue nil)) |
| 49 | + expect((@fp.external_encoding rescue nil)).to eq(@ext) |
| 50 | + expect((@fp.internal_encoding rescue nil)).to eq(@int) |
53 | 51 | expect(expect_flags).to eq((expect_flags & @fp.fcntl(Fcntl::F_GETFL))) |
54 | 52 | expect(@fp.sync).to be_truthy |
55 | 53 |
|
|
71 | 69 | Encoding.list.each do |encoding| |
72 | 70 | File.open(@tmp_path, "a:#{encoding.to_s}") do |fp| |
73 | 71 | fp.sync = true |
74 | | - expect(encoding).to eq(fp.external_encoding) |
| 72 | + expect(fp.external_encoding).to eq(encoding) |
75 | 73 | expect(fp.internal_encoding).to be_nil |
76 | 74 | File.unlink(@tmp_path) |
77 | 75 | expect(File.exist?(@tmp_path)).to be_falsey |
|
80 | 78 | expect(@tmp_path).to eq(fp.path) |
81 | 79 | expect(File.exist?(@tmp_path)).to be_truthy |
82 | 80 | expect(fp.stat.inspect).to eq(File.stat(@tmp_path).inspect) |
83 | | - pending("ruby 3.4 reopen resets the encoding to nil!") if "3.4.0" <= RUBY_VERSION |
84 | | - expect(encoding).to eq(fp.external_encoding) |
| 81 | + expect(fp.external_encoding).to eq(encoding) |
85 | 82 | expect(fp.internal_encoding).to be_nil |
86 | 83 | expect(expect_flags).to eq((expect_flags & fp.fcntl(Fcntl::F_GETFL))) |
87 | 84 | expect(fp.sync).to be_truthy |
|
96 | 93 | next if ext == int |
97 | 94 | File.open(@tmp_path, "a:#{ext.to_s}:#{int.to_s}") do |fp| |
98 | 95 | fp.sync = true |
99 | | - expect(ext).to eq(fp.external_encoding) |
| 96 | + expect(fp.external_encoding).to eq(ext) |
100 | 97 |
|
101 | 98 | if ext != Encoding::BINARY |
102 | 99 | expect(int).to eq(fp.internal_encoding) |
|
109 | 106 | expect(@tmp_path).to eq(fp.path) |
110 | 107 | expect(File.exist?(@tmp_path)).to be_truthy |
111 | 108 | expect(fp.stat.inspect).to eq(File.stat(@tmp_path).inspect) |
112 | | - pending("ruby 3.4 reopen resets the encoding to nil!") if "3.4.0" <= RUBY_VERSION |
113 | | - expect(ext).to eq(fp.external_encoding) |
| 109 | + expect(fp.external_encoding).to eq(ext) |
114 | 110 |
|
115 | 111 | if ext != Encoding::BINARY |
116 | | - expect(int).to eq(fp.internal_encoding) |
| 112 | + expect(fp.internal_encoding).to eq(int) |
117 | 113 | end |
118 | 114 |
|
119 | 115 | expect(expect_flags).to eq((expect_flags & fp.fcntl(Fcntl::F_GETFL))) |
|
0 commit comments