Sha256: 8f2acc524a9f99bb5c9f0394ae32e67c47e007c31ff5cecf6207f7fa83807264
Contents?: true
Size: 907 Bytes
Versions: 30
Compression:
Stored size: 907 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 = lambda { "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
30 entries across 30 versions & 4 rubygems