Sha256: 0b7d0f4df2b212573c4c8dfc80414eed2191d39fd950b3fc9556bb25ec2d9e53

Contents?: true

Size: 661 Bytes

Versions: 1

Compression:

Stored size: 661 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Relation::Header.coerce' do
  subject { object.coerce(argument) }

  let(:object) { Relation::Header }

  context 'when the argument is a Header' do
    let(:argument) { object.new([ [ :id, Integer ] ]) }

    it { should equal(argument) }
  end

  context 'when the argument responds to #to_ary' do
    let(:argument) { [ [ :id, Integer ] ] }

    it { should be_kind_of(object) }

    it { should == argument }
  end

  context 'when the argument is not a Header and does not respond to #to_ary' do
    let(:argument) { { :id => Integer } }

    specify { expect { subject }.to raise_error(NoMethodError) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/relation/header/class_methods/coerce_spec.rb