Sha256: 4d0975ad6db0bb9e3d427239288c9827469736ee647fd99a2004452784984a88

Contents?: true

Size: 643 Bytes

Versions: 2

Compression:

Stored size: 643 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Materialized, '#empty?' do
  subject { object.empty? }

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

  context 'with a body containing no entries' do
    let(:body) { [] }

    it { should be(true) }

    it 'does not execute body#each' do
      body.should_not_receive(:each)
      subject
    end
  end

  context 'with a body containing an entry' do
    let(:body) { [ [ 1 ] ] }

    it { should be(false) }

    it 'does not execute body#each' do
      body.should_not_receive(:each)
      subject
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veritas-0.0.5 spec/unit/veritas/relation/materialized/empty_spec.rb
veritas-0.0.4 spec/unit/veritas/relation/materialized/empty_spec.rb