Sha256: 54a515a33a88096f8ffb2562cbf60bcdfc95da590f0407a52963a35a8e6c70bb

Contents?: true

Size: 613 Bytes

Versions: 5

Compression:

Stored size: 613 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__)))

describe "delay_build plugin" do 
  it "does not build rack app until app is called" do
    app(:delay_build){"a"}
    app.instance_variable_get(:@app).should == nil
    body.should == "a"
    app.instance_variable_get(:@app).should_not == nil
  end

  it "only rebuilds the app if build! is called" do
    app(:delay_build){"a"}
    body.should == "a"
    c = Class.new do
      def initialize(_) end
      def call(_) [200, {}, ["b"]] end
    end
    app.use c
    body.should == "a"
    app.build!
    body.should == "b"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roda-2.2.0 spec/plugin/delay_build_spec.rb
roda-2.1.0 spec/plugin/delay_build_spec.rb
roda-2.0.0 spec/plugin/delay_build_spec.rb
roda-1.3.0 spec/plugin/delay_build_spec.rb
roda-1.2.0 spec/plugin/delay_build_spec.rb