Sha256: b7a95f32f93fdf0f7664354284b9daa14dc31c976c14163eb8f50cd212abf4d9

Contents?: true

Size: 646 Bytes

Versions: 9

Compression:

Stored size: 646 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).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

9 entries across 9 versions & 1 rubygems

Version Path
roda-2.29.0 spec/plugin/delay_build_spec.rb
roda-2.28.0 spec/plugin/delay_build_spec.rb
roda-2.27.0 spec/plugin/delay_build_spec.rb
roda-2.26.0 spec/plugin/delay_build_spec.rb
roda-2.25.0 spec/plugin/delay_build_spec.rb
roda-2.24.0 spec/plugin/delay_build_spec.rb
roda-2.23.0 spec/plugin/delay_build_spec.rb
roda-2.22.0 spec/plugin/delay_build_spec.rb
roda-2.21.0 spec/plugin/delay_build_spec.rb