Skip to content

Commit cecf04f

Browse files
committed
Cleaner .encode / .force_encoding
1 parent 6a44481 commit cecf04f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/json/json_parser_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ def test_construction
1919
assert_equal 'test', parser.source
2020
end
2121

22-
def test_argument_encoding
23-
source = "{}".encode("UTF-16")
22+
def test_argument_encoding_unmodified
23+
source = "{}".encode(Encoding::UTF_16)
2424
JSON::Parser.new(source)
2525
assert_equal Encoding::UTF_16, source.encoding
2626
end
2727

28-
def test_argument_encoding_for_binary
29-
source = "{}".encode("ASCII-8BIT")
28+
def test_argument_encoding_for_binary_unmodified
29+
source = "{}".b
3030
JSON::Parser.new(source)
3131
assert_equal Encoding::ASCII_8BIT, source.encoding
3232
end

0 commit comments

Comments
 (0)