Sha256: e99d19cda140dd08cb4420056e5a1cab23d12b745bf321de6bc3d9965cb50e03

Contents?: true

Size: 489 Bytes

Versions: 16

Compression:

Stored size: 489 Bytes

Contents

require 'spec_helper'

describe Gush::JSON do
  subject { described_class }

  describe ".encode" do
    it "encodes data to JSON" do
      expect(subject.encode({a: 123})).to eq("{\"a\":123}")
    end
  end

  describe ".decode" do
    it "decodes JSON to data" do
      expect(subject.decode("{\"a\":123}")).to eq({"a" => 123})
    end

    it "passes options to the internal parser" do
      expect(subject.decode("{\"a\":123}", symbolize_keys: true)).to eq({a: 123})
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
gush-4.1.0 spec/gush/json_spec.rb
gush-4.0.0 spec/gush/json_spec.rb
gush-3.0.0 spec/gush/json_spec.rb
gush-2.1.0 spec/gush/json_spec.rb
gush-2.0.2 spec/gush/json_spec.rb
gush-2.0.1 spec/gush/json_spec.rb
gush-2.0.0 spec/gush/json_spec.rb
gush-1.1.1 spec/gush/json_spec.rb
gush-1.1.0 spec/gush/json_spec.rb
gush-1.0.0 spec/gush/json_spec.rb
gush-mmx-0.4.2 spec/gush/json_spec.rb
gush-0.4.1 spec/gush/json_spec.rb
gush-0.3.3 spec/gush/json_spec.rb
gush-0.4 spec/gush/json_spec.rb
gush-0.3.2 spec/gush/json_spec.rb
gush-0.3.1 spec/gush/json_spec.rb