Sha256: b12ae14f9ab4d2e089cea11ff1ef1379e30d4d8ab66fbfc2c772749ae22cb94c

Contents?: true

Size: 544 Bytes

Versions: 3

Compression:

Stored size: 544 Bytes

Contents

require 'spec_helper'
module Qrb
  describe System, "initialize" do

    let(:system){ System.new }

    context 'for building a tuple type' do
      subject{
        system.tuple(r: Integer)
      }
      
      it{ should be_a(TupleType) }
    end

    context 'for building a sub type' do
      subject{
        system.subtype(Integer){|i| i>=0 }
      }

      it{ should be_a(SubType) }

      it 'should apply the constraint' do
        ->{
          subject.dress(-9)
        }.should raise_error(TypeError)
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qrb-0.3.0 spec/unit/system/test_dsl.rb
qrb-0.2.0 spec/unit/system/test_dsl.rb
qrb-0.1.0 spec/unit/system/test_dsl.rb