Skip to content

Commit

Permalink
Cleaner .encode / .force_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Oct 24, 2024
1 parent 6a44481 commit cecf04f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/json/json_parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ def test_construction
assert_equal 'test', parser.source
end

def test_argument_encoding
source = "{}".encode("UTF-16")
def test_argument_encoding_unmodified
source = "{}".encode(Encoding::UTF_16)
JSON::Parser.new(source)
assert_equal Encoding::UTF_16, source.encoding
end

def test_argument_encoding_for_binary
source = "{}".encode("ASCII-8BIT")
def test_argument_encoding_for_binary_unmodified
source = "{}".b
JSON::Parser.new(source)
assert_equal Encoding::ASCII_8BIT, source.encoding
end
Expand Down

0 comments on commit cecf04f

Please sign in to comment.