Sha256: cd4edc799dac4bcc97c4bd336026fd6a76bef5db48e5fb8a86dbd4f7e5d39ea8

Contents?: true

Size: 597 Bytes

Versions: 16

Compression:

Stored size: 597 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '../../',  'spec_helper'))

module Hoth
  module Encoding
    
    describe Json do
      
      it "should decode a JSON string" do
        decoded_json = Json.decode '{"test":23}'
        decoded_json.should ==({"test" => 23})
      end
      
      it "should encode a JSON string" do
        encoded_json = Json.encode({"test" => 23})
        '{"test":23}'.should == encoded_json
      end
      
      it "should know its ContentType" do
        Json.content_type.should == "application/json"
      end
      
    end
    
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
hoth-0.4.2 spec/unit/encoding/json_spec.rb
hoth-0.4.1 spec/unit/encoding/json_spec.rb
hoth-0.4.0 spec/unit/encoding/json_spec.rb
hoth-0.3.4 spec/unit/encoding/json_spec.rb
hoth-0.3.3 spec/unit/encoding/json_spec.rb
hoth-0.3.2.beta4 spec/unit/encoding/json_spec.rb
hoth-0.3.2.beta3 spec/unit/encoding/json_spec.rb
hoth-0.3.2.beta2 spec/unit/encoding/json_spec.rb
hoth-0.3.2.beta1 spec/unit/encoding/json_spec.rb
hoth-0.3.1 spec/unit/encoding/json_spec.rb
sk-hoth-0.3.5 spec/unit/encoding/json_spec.rb
sk-hoth-0.3.4 spec/unit/encoding/json_spec.rb
sk-hoth-0.3.2 spec/unit/encoding/json_spec.rb
sk-hoth-0.3.1 spec/unit/encoding/json_spec.rb
sk-hoth-0.3.0 spec/unit/encoding/json_spec.rb
hoth-0.3.0 spec/unit/encoding/json_spec.rb