Sha256: 57f8d186b1450d7b3ac8ebad3418cba335e7be4bbabca3715038f284f8acfa1a

Contents?: true

Size: 611 Bytes

Versions: 6

Compression:

Stored size: 611 Bytes

Contents

require 'hovercraft/loader'

describe Hovercraft::Loader do
  let(:model)  { stub(name: 'Robot') }
  let(:models) { Array.new(3) { model } }
  let(:params) { models.map { |m| [m, 'robot', 'robots'] } }

  describe '#with_each_model' do
    before { subject.stub(models: models) }

    it 'yields the class, name, and plural name of each model' do
      expect { |b| subject.with_each_model(&b) }.to yield_successive_args(*params)
    end
  end

  describe '#models' do
    it 'is memoized' do
      subject.should_receive(:require_models).once.and_return([])

      2.times { subject.models }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hovercraft-0.2.1 spec/hovercraft/loader_spec.rb
hovercraft-0.2.0 spec/hovercraft/loader_spec.rb
hovercraft-0.1.1 spec/hovercraft/loader_spec.rb
hovercraft-0.1.0 spec/hovercraft/loader_spec.rb
hovercraft-0.0.2 spec/hovercraft/loader_spec.rb
hovercraft-0.0.1 spec/hovercraft/loader_spec.rb