Sha256: 33943a94e5a469308e7999c32cbac2120b628c63ba07bcef0e97e80ef8457b2a

Contents?: true

Size: 696 Bytes

Versions: 8

Compression:

Stored size: 696 Bytes

Contents

require "spec_helper"

describe Blocks do
  it "should provide a util method to render a template" do
    view = stub
    options = stub
    partial = stub
    block = Proc.new { |options| }
    base_mock = mock
    base_mock.expects(:render_template).with(partial)
    Blocks::Base.expects(:new).with(view, options).returns(base_mock)

    Blocks.render_template(view, partial, options, &block)
  end

  it "should provide a setup method that can be called from an initializer" do
    Blocks.template_folder.should eql("blocks")
    Blocks.setup do |config|
      config.should eql(Blocks)
      config.template_folder = "shared"
    end
    Blocks.template_folder.should eql("shared")
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blocks-2.5.1 spec/blocks/blocks_spec.rb
blocks-2.5.0 spec/blocks/blocks_spec.rb
blocks-2.4.0 spec/blocks/blocks_spec.rb
blocks-2.3.1 spec/blocks/blocks_spec.rb
blocks-2.3.0 spec/blocks/blocks_spec.rb
blocks-2.2.1 spec/blocks/blocks_spec.rb
blocks-2.2.0 spec/blocks/blocks_spec.rb
blocks-2.1.0 spec/blocks/blocks_spec.rb