Sha256: e6f2f1409be290733c0fa6794fc3722193168813709a3cbe6adab95a13bbd5b2

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

describe "StrongJSON.new" do
  it "tests the structure of a JSON object" do
    s = StrongJSON.new do
      let :item, object(id: prohibited, name: string, count: numeric, price: numeric)
      let :checkout, object(id: prohibited, items: array(item), change: optional(number))
    end

    expect(s.checkout.coerce(items: [ { name: "test", count: 1, price: "2.33", comment: "dummy" } ])).to eq(items: [ { name: "test", count: 1, price: "2.33" }])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strong_json-0.0.1 spec/spec.rb