Sha256: 1a4213c6f399810bb4f9ce8fc56bd43cf624dbc5dba462b4a78b3055f6e59ed4

Contents?: true

Size: 770 Bytes

Versions: 7

Compression:

Stored size: 770 Bytes

Contents

require 'spec_helper'

describe "Heading extra are properly resolved" do

  describe "When the extra map to a type" do
    let(:schema){
      Finitio.system <<~F
        Type = { ... : World }
        World = .String
        Type
      F
    }

    it 'works' do
      expect(schema.dress("hello" => "World")).to eql(hello: "World")
    end
  end

  describe "When the extra maps to nothing" do
    let(:schema){
      Finitio.system <<~F
        {
          hello: .String
          ...
        }
      F
    }

    it 'works' do
      expect(schema.dress("hello" => "World")).to eql(hello: "World")
    end

    it 'supports extra' do
      expect(schema.dress({
        "hello" => "World",
        "extra" => "Foo"
      })).to eql(hello: "World")
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
finitio-0.12.0 spec/regression/test_heading_extra_are_proxy_resolved.rb
finitio-0.11.4 spec/regression/test_heading_extra_are_proxy_resolved.rb
finitio-0.11.3 spec/regression/test_heading_extra_are_proxy_resolved.rb
finitio-0.11.2 spec/regression/test_heading_extra_are_proxy_resolved.rb
finitio-0.11.1 spec/regression/test_heading_extra_are_proxy_resolved.rb
finitio-0.10.0 spec/regression/test_heading_extra_are_proxy_resolved.rb
finitio-0.9.1 spec/regression/test_heading_extra_are_proxy_resolved.rb