Sha256: e132b79b92555458e9ad4a9da57423a67dee450a9590158add70a04f65381de7

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Empty, '#each' do
  subject { object.each { |tuple| yields << tuple } }

  let(:header) { [ [ :id, Integer ] ] }
  let(:yields) { []                   }

  context 'with an empty relation having no tuples' do
    let(:object) { described_class.new(header) }

    it_should_behave_like 'an #each method'

    it 'yields no tuples' do
      subject
      yields.should be_empty
    end
  end

  context 'with an empty relation having tuples' do
    let(:tuples) { mock('Tuples')                      }
    let(:object) { described_class.new(header, tuples) }

    it_should_behave_like 'an #each method'

    it 'yields no tuples' do
      subject
      yields.should be_empty
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/relation/empty/each_spec.rb