Sha256: 8a100536f6c05fe1b2313c987458db28c05938f23c8fe1a72d66e0431f9b76ff
Contents?: true
Size: 989 Bytes
Versions: 19
Compression:
Stored size: 989 Bytes
Contents
require 'spec_helper' module Finitio describe TypeFactory, "Factory#tuple" do let(:factory){ TypeFactory.new } let(:expected){ factory.tuple(r: Integer) } context 'when use with {r: Integer}' do subject{ factory.type(r: Integer) } it{ should eq(expected) } end context 'when use with {r: Integer} and a name' do subject{ factory.type({r: Integer}, "MyTuple") } it{ should eq(expected) } it 'should have the correct name' do expect(subject.name).to eq("MyTuple") end end context 'when use with {r: 0..255} and a name' do subject{ factory.type({r: 0..255}, "MyTuple") } it{ should be_a(TupleType) } it 'should have the correct constraint on r' do subject.dress(r: 36) expect{ subject.dress(r: 543) }.to raise_error(TypeError) end it 'should have the correct name' do expect(subject.name).to eq("MyTuple") end end end end
Version data entries
19 entries across 19 versions & 1 rubygems