Sha256: 982a5a3d544fd33f5750c137eb8891b3c6efcb4165fdba197aa567dc469bb155

Contents?: true

Size: 602 Bytes

Versions: 20

Compression:

Stored size: 602 Bytes

Contents

require_relative "../spec_helper"

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).must_be_nil
    body.must_equal "a"
    # Work around minitest bug
    refute_equal app.instance_variable_get(:@app), nil
  end

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
roda-3.18.0 spec/plugin/delay_build_spec.rb
roda-3.17.0 spec/plugin/delay_build_spec.rb
roda-3.16.0 spec/plugin/delay_build_spec.rb
roda-3.15.0 spec/plugin/delay_build_spec.rb
roda-3.14.1 spec/plugin/delay_build_spec.rb
roda-3.14.0 spec/plugin/delay_build_spec.rb
roda-3.13.0 spec/plugin/delay_build_spec.rb
roda-3.12.0 spec/plugin/delay_build_spec.rb
roda-3.11.0 spec/plugin/delay_build_spec.rb
roda-3.10.0 spec/plugin/delay_build_spec.rb
roda-3.9.0 spec/plugin/delay_build_spec.rb
roda-3.8.0 spec/plugin/delay_build_spec.rb
roda-3.7.0 spec/plugin/delay_build_spec.rb
roda-3.6.0 spec/plugin/delay_build_spec.rb
roda-3.5.0 spec/plugin/delay_build_spec.rb
roda-3.4.0 spec/plugin/delay_build_spec.rb
roda-3.3.0 spec/plugin/delay_build_spec.rb
roda-3.2.0 spec/plugin/delay_build_spec.rb
roda-3.1.0 spec/plugin/delay_build_spec.rb
roda-3.0.0 spec/plugin/delay_build_spec.rb