Sha256: 9b37ec34246ee464d3db0dc90d7e1d5ae11d1695709b97fe610e75cc984d9484

Contents?: true

Size: 622 Bytes

Versions: 2

Compression:

Stored size: 622 Bytes

Contents

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

    let(:type){ SubType.new(intType, {default: ->(i){ i>0 }, small: ->(i){ i<255 }}, "byte") }

    subject{ type.include?(arg) }

    context 'when included on int' do
      let(:arg){ 12 }

      it{ should be_true }
    end

    context 'when not included on int (I)' do
      let(:arg){ -12 }

      it{ should be_false }
    end

    context 'when not included on int (II)' do
      let(:arg){ 255 }

      it{ should be_false }
    end

    context 'when not included' do
      let(:arg){ "12" }

      it{ should be_false }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finitio-0.4.1 spec/unit/type/sub_type/test_include.rb
finitio-0.4.0 spec/unit/type/sub_type/test_include.rb