Sha256: b9619eba1b8707156e4503d26abbcb14950a78f2e9ef2b64caa5acc6b22a724c
Contents?: true
Size: 1.52 KB
Versions: 2
Compression:
Stored size: 1.52 KB
Contents
require ::File.expand_path( ::File.join(::File.dirname(__FILE__), %w[.. .. spec_helper])) # --------------------------------------------------------------------------- describe Webby::Helpers::CaptureHelper do CFN = ::File.expand_path(::File.join(::File.dirname(__FILE__), '..', '..', 'capture_for_yaml.txt')) CLINES = [ "--- ", "filter: ", " - erb ", "--- ", "Hello world!", "<% content_for :sidebar do %>", "I'm sidebar content.", "<% end %>" ] before :all do ::File.open(CFN,'w') {|fd| fd.write CLINES.join("\n") } end before :each do @renderman = Webby::Renderer.new( Webby::Resources::Page.new(CFN)) @page_content = @renderman.render_page end after :all do ::FileUtils.rm_f(CFN) end it 'should not "leak" any content to containing page' do @page_content.should_not be_nil @page_content.should eql("Hello world!\n") end it "should return the stored content for the given key" do @renderman.content_for(:sidebar).should_not be_nil @renderman.content_for(:sidebar).should eql("\nI'm sidebar content.\n") # Note: Leading newline end it "should report if content is associated with a given key" do @renderman.content_for?(:sidebar).should == true @renderman.content_for?(:header).should == false end it "should clear content associated with a given key" do @renderman.content_for?(:sidebar).should == true @renderman.delete_content_for(:sidebar) @renderman.content_for?(:sidebar).should == false end end # EOF
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
webby-0.8.3 | spec/webby/helpers/capture_helper_spec.rb |
webby-0.8.4 | spec/webby/helpers/capture_helper_spec.rb |