Sha256: 979956ba1156c0ae5d60289fa0194152c5cdbf2394a521e13240838d6c6c5969

Contents?: true

Size: 590 Bytes

Versions: 10

Compression:

Stored size: 590 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 "supports the build! method for backwards compatibility" 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
    app.build!
    body.must_equal "b"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
roda-3.28.0 spec/plugin/delay_build_spec.rb
roda-3.27.0 spec/plugin/delay_build_spec.rb
roda-3.26.0 spec/plugin/delay_build_spec.rb
roda-3.25.0 spec/plugin/delay_build_spec.rb
roda-3.24.0 spec/plugin/delay_build_spec.rb
roda-3.23.0 spec/plugin/delay_build_spec.rb
roda-3.22.0 spec/plugin/delay_build_spec.rb
roda-3.21.0 spec/plugin/delay_build_spec.rb
roda-3.20.0 spec/plugin/delay_build_spec.rb
roda-3.19.0 spec/plugin/delay_build_spec.rb