Sha256: 0c598a06aa3460bfd37aea7c7970655b05ab4652554e0d22f2abe967a860429c

Contents?: true

Size: 569 Bytes

Versions: 4

Compression:

Stored size: 569 Bytes

Contents

require 'spec_helper'
module Alf
  module Types
    describe Tuple, '.coerce' do

      subject{ Tuple.coerce(arg) }

      let(:expected){ Tuple[name: String].new(:name => "bla") }

      context 'on self' do
        let(:arg){ expected }

        it { should be(expected) }
      end

      context 'on a Tuple' do
        let(:arg){ Tuple[name: String].new(:name => "bla") }

        it{ should eq(expected) }
      end

      context 'on an unsymbolized Hash' do
        let(:arg){ {'name' => "bla"} }

        it{ should eq(expected) }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-relation/tuple/class/test_coerce.rb
alf-core-0.14.0 spec/unit/alf-relation/tuple/class/test_coerce.rb
alf-core-0.13.1 spec/unit/alf-relation/tuple/class/test_coerce.rb
alf-core-0.13.0 spec/unit/alf-relation/tuple/class/test_coerce.rb