Sha256: 15e2b4985cc85467c6ee0cda29aed1ff2ca59a17d0c22b9dd1d5e9f0be6a1249

Contents?: true

Size: 621 Bytes

Versions: 19

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'
module Finitio
  describe BuiltinType, "dress" do

    let(:type){ BuiltinType.new(Integer, 'int') }

    subject{ type.dress(arg) }

    context 'with an Integer' do
      let(:arg){ 12 }

      it{ should be(arg) }
    end

    context 'with a Float' do
      let(:arg){ 12.0 }

      subject{
        type.dress(arg) rescue $!
      }

      it 'should raise an Error' do
        expect(subject).to be_a(TypeError)
        expect(subject.message).to eq("Invalid int `12.0`")
      end

      it 'should have no location' do
        expect(subject.location).to eq('')
      end
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
finitio-0.12.0 spec/type/builtin_type/test_dress.rb
finitio-0.11.4 spec/type/builtin_type/test_dress.rb
finitio-0.11.3 spec/type/builtin_type/test_dress.rb
finitio-0.11.2 spec/type/builtin_type/test_dress.rb
finitio-0.11.1 spec/type/builtin_type/test_dress.rb
finitio-0.10.0 spec/type/builtin_type/test_dress.rb
finitio-0.9.1 spec/type/builtin_type/test_dress.rb
finitio-0.9.0 spec/type/builtin_type/test_dress.rb
finitio-0.8.0 spec/type/builtin_type/test_dress.rb
finitio-0.7.0 spec/type/builtin_type/test_dress.rb
finitio-0.7.0.pre.rc4 spec/type/builtin_type/test_dress.rb
finitio-0.7.0.pre.rc3 spec/type/builtin_type/test_dress.rb
finitio-0.7.0.pre.rc2 spec/type/builtin_type/test_dress.rb
finitio-0.7.0.pre.rc1 spec/type/builtin_type/test_dress.rb
finitio-0.6.1 spec/type/builtin_type/test_dress.rb
finitio-0.6.0 spec/type/builtin_type/test_dress.rb
finitio-0.5.2 spec/type/builtin_type/test_dress.rb
finitio-0.5.1 spec/type/builtin_type/test_dress.rb
finitio-0.5.0 spec/type/builtin_type/test_dress.rb