Sha256: 082adbe6bace4d2be030dff90210af1b4bb4ea43ae85a2df67ebee127043b80d
Contents?: true
Size: 578 Bytes
Versions: 10
Compression:
Stored size: 578 Bytes
Contents
require "minitest/autorun" require "fog/json" class TestJSONEncoding < Minitest::Test def test_encode_array @array = %W(one two three) @expected = %q{["one","two","three"]} assert_equal @expected, Fog::JSON.encode(@array) end def test_encode_hash @hash = { "key" => "value" } @expected = %q{{"key":"value"}} assert_equal @expected, Fog::JSON.encode(@hash) end def test_encode_with_bad_input skip if %w(1.8.7 2.0.0).include?(RUBY_VERSION) assert_raises(Fog::JSON::EncodeError) { Fog::JSON.encode("\x82\xAC\xEF") } end end
Version data entries
10 entries across 7 versions & 3 rubygems