Sha256: d1d6ce610860d0ff655569189b45466af47436d89a4e7669a0cdbf173a21808a
Contents?: true
Size: 821 Bytes
Versions: 1
Compression:
Stored size: 821 Bytes
Contents
# encoding: UTF-8 require 'spec_helper' describe Esearch::Presenter, '.new' do let(:object) { class_under_test } subject { object.new(raw) } let(:value) { double('Value') } class DummyPresenter include Concord.new(:raw) end context 'with exposed tagged collection' do let(:raw) { { 'foo' => { 'bar' => { 'baz' => 'bor' } } } } let(:class_under_test) do Class.new(described_class) do expose_tagged_collection(:foo, DummyPresenter) end end its(:foo) { should eql([DummyPresenter.new('baz' => 'bor', 'name' => 'bar')]) } end context 'with exposed primitive' do let(:raw) { { 'foo' => value } } let(:class_under_test) do Class.new(described_class) do expose_primitive :foo end end its(:foo) { should be(value) } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
esearch-0.2.2 | spec/unit/esearch/presenter/class_methods/new_spec.rb |