Sha256: 385eacd14c61a8e27644ddf9f16cd7f7c7427dc62b9c1374928cad14fcedbcba

Contents?: true

Size: 692 Bytes

Versions: 5

Compression:

Stored size: 692 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Axiom::Types::ValueComparable, '#finalize' do
  subject { object.finalize }

  let(:object) do
    Class.new(Axiom::Types::Type) do
      extend Axiom::Types::ValueComparable
      minimum 1
      maximum 2
    end
  end

  it_should_behave_like 'a command method'
  it_should_behave_like 'an idempotent method'

  it { should be_frozen }

  its(:constraint) { should be_frozen }

  it 'adds a constraint that returns true for a value within range' do
    should include(1)
    should include(2)
  end

  it 'adds a constraint that returns false for a value not within range' do
    should_not include(0)
    should_not include(3)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
axiom-types-0.0.5 spec/unit/axiom/types/value_comparable/finalize_spec.rb
axiom-types-0.0.4 spec/unit/axiom/types/value_comparable/finalize_spec.rb
axiom-types-0.0.3 spec/unit/axiom/types/value_comparable/finalize_spec.rb
axiom-types-0.0.2 spec/unit/axiom/types/value_comparable/finalize_spec.rb
axiom-types-0.0.1 spec/unit/axiom/types/value_comparable/finalize_spec.rb