Sha256: cacfe87fc5da291c3f80cbe6ccee0bc08a755b7332b650cdc1b519697169ab18

Contents?: true

Size: 628 Bytes

Versions: 2

Compression:

Stored size: 628 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation, '.coerce' do
  subject { object.coerce(header, argument) }

  let(:header)   { [[:id, Integer]]            }
  let(:object)   { described_class             }
  let(:relation) { Relation.new(header, [[1]]) }

  context 'when the argument is a Relation' do
    let(:argument) { relation }

    it { should be(relation) }
  end

  context 'when the argument is an Array' do
    let(:argument) { [[1]] }

    it { should eql(relation) }
  end

  context 'when the argument is not Enumerable' do
    let(:argument) { Object.new }

    it { should be(argument) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-0.2.0 spec/unit/axiom/relation/class_methods/coerce_spec.rb
axiom-0.1.1 spec/unit/axiom/relation/class_methods/coerce_spec.rb