Sha256: 3782a13461af7ffe2a640b101d3fc7c0d67ac526701df162361022746fd8afe2

Contents?: true

Size: 972 Bytes

Versions: 1

Compression:

Stored size: 972 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Attribute::Numeric#joinable?' do
  subject { object.joinable?(other) }

  let(:klass)  { Attribute::Numeric                 }
  let(:size)   { 10..20                             }
  let(:object) { klass.new(:numeric, :size => size) }

  context 'when the attribute types and sizes are the same' do
    let(:other) { klass.new(:numeric, :size => size) }

    it { should be(true) }

    it 'is symmetric' do
      should == other.joinable?(object)
    end
  end

  context 'when the attribute types are the same and the sizes are different' do
    let(:other) { klass.new(:numeric, :size => 1..20) }

    it { should be(false) }

    it 'is symmetric' do
      should == other.joinable?(object)
    end
  end

  context 'when the attribute types are different' do
    let(:other) { Attribute::String.new(:different) }

    it { should be(false) }

    it 'is symmetric' do
      should == other.joinable?(object)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/attribute/numeric/joinable_spec.rb