Sha256: c96e71a91c7bc639e88f5778c35c2529ee69cb7a9a2cdb1829d75557ffb87d5f

Contents?: true

Size: 743 Bytes

Versions: 2

Compression:

Stored size: 743 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Attribute::String, '#include?' do
  subject { object.include?(value) }

  let(:object) { described_class.new(:string, minimum_length: 1, maximum_length: 50) }

  context 'with a string value' do
    context 'that is within the allowed length range' do
      let(:value) { 'a' }

      it { should be(true) }
    end

    context 'that is greater than the allowed length range' do
      let(:value) { 'a' * 51 }

      it { should be(false) }
    end

    context 'that is less than the allowed length range' do
      let(:value) { '' }

      it { should be(false) }
    end
  end

  context 'with a value that is not a string' do
    let(:value) { 1 }

    it { should be(false) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-0.2.0 spec/unit/axiom/attribute/string/include_predicate_spec.rb
axiom-0.1.1 spec/unit/axiom/attribute/string/include_predicate_spec.rb