Sha256: a9553994e00c1a9fe6ee5cfa3aadec473e789b47f38fd87c2cd43d95d7252b7a

Contents?: true

Size: 764 Bytes

Versions: 1

Compression:

Stored size: 764 Bytes

Contents

require 'spec_helper'

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

  let(:klass)  { Attribute::String                    }
  let(:object) { klass.new(:string, :length => 1..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

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/attribute/string/valid_value_spec.rb