Sha256: 8a7a97ca7dd402e8f6b868952dc4ceedc1867e9011845672c63ded122dafa2ee

Contents?: true

Size: 691 Bytes

Versions: 19

Compression:

Stored size: 691 Bytes

Contents

require 'spec_helper'
module Finitio
  describe SeqType, "include?" do

    let(:type){ SeqType.new(intType) }

    subject{ type.include?(arg) }

    context 'when included on empty array' do
      let(:arg){ [] }

      it{ should eq(true) }
    end

    context 'when included on non empty array' do
      let(:arg){ [] }

      before do
        arg << 12
      end

      it{ should eq(true) }
    end

    context 'when not an array' do
      let(:arg){ Set.new }

      it{ should eq(false) }
    end

    context 'when an array with non ints' do
      let(:arg){ [] }

      before do
        arg << 12
        arg << "foo"
      end

      it{ should eq(false) }
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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