Sha256: 764f6ec8338d134ad07020ff7e06db40ded76af7eeab53bc20049d0977392e8a
Contents?: true
Size: 1.01 KB
Versions: 11
Compression:
Stored size: 1.01 KB
Contents
require 'spec_helper' module Queuel module Serialization module Json describe Decoder do let(:body) { '{"name":"jon"}' } subject { described_class.new body } it "can call from the class" do described_class.call(body).should == { name: "jon" } end it "can decode from instance" do subject.decode.should == { name: "jon" } end describe "with bad body" do let(:body) { '{"name":"jon"' } it "fails on bad body" do expect { subject.decode }.to raise_error SerializationError end end end describe Encoder do let(:encoded_body) { '{"name":"jon"}' } let(:body) { { "name" => "jon" } } subject { described_class.new body } it "can call from the class" do described_class.call(body).should == encoded_body end it "can decode from instance" do subject.encode.should == encoded_body end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems