Sha256: 0fffdb094514115dc7ffd304d48cb2c7d4130579d3380372f671615692c705a4

Contents?: true

Size: 708 Bytes

Versions: 2

Compression:

Stored size: 708 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

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

  let(:object) { described_class.new(:numeric, size: 1..50) }

  context 'with a numeric value' do
    context 'that is within the allowed size range' do
      let(:value) { 1 }

      it { should be(true) }
    end

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

      it { should be(false) }
    end

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

      it { should be(false) }
    end
  end

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

    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/numeric/include_predicate_spec.rb
axiom-0.1.1 spec/unit/axiom/attribute/numeric/include_predicate_spec.rb