Sha256: 60825d40e9277cd93caa260f0fbbfa6fa80ea5e5f6157342167c73de2b927b80
Contents?: true
Size: 909 Bytes
Versions: 12
Compression:
Stored size: 909 Bytes
Contents
require File.dirname(__FILE__) + "/../../../spec_helper" class TemplateStub attr_accessor :block def capture(&block) @block = block end end describe Radiant::AdminUI::RegionPartials do before :each do @template = TemplateStub.new @rp = Radiant::AdminUI::RegionPartials.new(@template) end it "should return a string when the specified partial does not exist" do @rp['foo'].should == "<strong>`foo' default partial not found!</strong>" end it "should expose partials via bracket accessor" do block = Proc.new { "Hello World!" } @rp.main(&block) @rp['main'].should === block end it "should capture a block when passed" do @rp.edit_extended_metadata do "Hello, World!" end @template.block.should be_kind_of(Proc) @template.block.should === @rp.edit_extended_metadata @template.block.call.should == "Hello, World!" end end
Version data entries
12 entries across 12 versions & 1 rubygems