Sha256: 2af49ee8b96b9566afdc4a9debb306b173259117802a336c955b2638ad9fc1ef

Contents?: true

Size: 622 Bytes

Versions: 4

Compression:

Stored size: 622 Bytes

Contents

require 'printfection'

module Printfection
  describe Size, "properties" do
    let(:json) do
      JSON.parse <<-JSON
        {
          "id": 1,
          "object": "size",
          "name": "Medium",
          "short_name": "M",
          "stock": {
            "available": 498
          }
        }
      JSON
    end

    it "gives access to JSON properties" do
      size = Size.new(json)
      expect(size.id).to eql 1
      expect(size.name).to eql "Medium"
      expect(size.short_name).to eql "M"

      expect(size.stock).to be_a Hashie::Mash
      expect(size.stock.available).to eql 498
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
printfection-1.0.3 spec/size_spec.rb
printfection-1.0.2 spec/size_spec.rb
printfection-1.0.1 spec/size_spec.rb
printfection-1.0.0 spec/size_spec.rb