Skip to content

Commit 823bb97

Browse files
casperisfinep
andauthored
Use encoding objects for comparison instead of encoding names (#2418)
* Stop checking encoding names Comparing the names is much less efficient than comparing the instance directly. It may also change in the future: https://bugs.ruby-lang.org/issues/18576 * fix one assertion Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent 2b40aac commit 823bb97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/integration/grid_fs_bucket_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
actual = stream.read
2727
end
2828

29-
actual.encoding.name.should == 'ASCII-8BIT'
30-
actual.should == data.dup.force_encoding('binary')
29+
actual.encoding.should == Encoding::BINARY
30+
actual.should == data.b
3131
end
3232
end
3333

@@ -41,7 +41,7 @@
4141

4242
context 'in UTF-8 encoding' do
4343
let(:data_to_write) do
44-
data.encoding.name.should == 'UTF-8'
44+
data.encoding.should == Encoding::UTF_8
4545
data.freeze
4646
end
4747

0 commit comments

Comments
 (0)