Sha256: d610bbbccee0ce838936e38f2f41ded1605b8092537c3c30375c443351017ef1

Contents?: true

Size: 527 Bytes

Versions: 34

Compression:

Stored size: 527 Bytes

Contents

require 'helper'

module Bixby
module Test

class TestJsonify < MiniTest::Unit::TestCase

  def test_to_json
    j = JFoo.new
    j.bar = "baz"
    json = j.to_json
    assert json
    assert_equal '{"bar":"baz"}', json
  end

  def test_from_json
    j1 = JFoo.new
    j1.bar = "baz"

    j2 = JFoo.from_json(j1.to_json)
    assert_equal "baz", j2.bar

    j3 = JFoo.from_json('{"bar":"baz"}')
    assert_equal "baz", j3.bar
  end

end # Jsonify

class JFoo
  include Jsonify
  attr_accessor :bar
end

end # Test
end # Bixby

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
bixby-common-0.7.1 test/util/jsonify_test.rb
bixby-common-0.7.0 test/util/jsonify_test.rb
bixby-common-0.6.6 test/util/jsonify_test.rb
bixby-common-0.6.5 test/util/jsonify_test.rb
bixby-common-0.6.4 test/util/jsonify_test.rb
bixby-common-0.6.3 test/util/jsonify_test.rb
bixby-common-0.6.2 test/util/jsonify_test.rb
bixby-common-0.6.1 test/util/jsonify_test.rb
bixby-common-0.6.0 test/util/jsonify_test.rb
bixby-common-0.5.0 test/util/jsonify_test.rb
bixby-common-0.4.13 test/util/jsonify_test.rb
bixby-common-0.4.12 test/util/jsonify_test.rb
bixby-common-0.4.11 test/util/jsonify_test.rb
bixby-common-0.4.10 test/util/jsonify_test.rb
bixby-common-0.4.9 test/util/jsonify_test.rb
bixby-common-0.4.8 test/util/jsonify_test.rb
bixby-common-0.4.7 test/util/jsonify_test.rb
bixby-common-0.4.6 test/util/jsonify_test.rb
bixby-common-0.4.5 test/util/jsonify_test.rb
bixby-common-0.4.4 test/util/jsonify_test.rb