Sha256: f8c06531602f11c0463d1e30cd4caf2b7b659467728d18346458e580899eb938
Contents?: true
Size: 1.41 KB
Versions: 11
Compression:
Stored size: 1.41 KB
Contents
describe Nanoc::Spec::HelperContext do let(:helper) do Module.new {} end subject(:ctx) { described_class.new(helper) } it 'has no items by default' do # TODO: Add #empty? to item collection view expect(subject.items.size).to eq(0) end it 'has no layouts by default' do # TODO: Add #empty? to item collection view expect(subject.layouts.size).to eq(0) end describe '#create_item' do subject { ctx.create_item('foo', {}, '/foo.md') } it 'creates item' do expect { subject } .to change { ctx.items.size } .from(0).to(1) end it 'creates item without reps' do subject expect(ctx.items['/foo.md'].reps.size).to eq(0) end it 'returns self' do expect(subject).to eq(ctx) end end describe '#create_layout' do subject { ctx.create_layout('foo', {}, '/foo.md') } it 'creates layout' do expect { subject } .to change { ctx.layouts.size } .from(0).to(1) end it 'returns self' do expect(subject).to eq(ctx) end end describe '#create_rep' do before do ctx.create_item('foo', {}, '/foo.md') end subject { ctx.create_rep(ctx.items['/foo.md'], '/foo.html') } it 'creates rep' do expect { subject } .to change { ctx.items['/foo.md'].reps.size } .from(0).to(1) end it 'returns self' do expect(subject).to eq(ctx) end end end
Version data entries
11 entries across 11 versions & 1 rubygems