Sha256: 20386e9dc6a929dd1f3ad1a0f2ff1904dfc9e6493b681311c913f28bba3ea2cc

Contents?: true

Size: 694 Bytes

Versions: 17

Compression:

Stored size: 694 Bytes

Contents

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

describe "Roda.request_module and .response_module" do
  it "should include given module in request or response class" do
    app(:bare) do
      request_module(Module.new{def h; halt response.finish end})
      response_module(Module.new{def finish; [1, {}, []] end})

      route do |r|
        r.h
      end
    end

    req.should == [1, {}, []]
  end

  it "should accept blocks and turn them into modules" do
    app(:bare) do
      request_module{def h; halt response.finish end}
      response_module{def finish; [1, {}, []] end}

      route do |r|
        r.h
      end
    end

    req.should == [1, {}, []]
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
roda-1.3.0 spec/module_spec.rb
roda-1.2.0 spec/module_spec.rb
roda-1.1.0 spec/module_spec.rb
roda-cj-1.0.5 spec/module_spec.rb
roda-cj-1.0.4 spec/module_spec.rb
roda-cj-1.0.3 spec/module_spec.rb
roda-cj-1.0.2 spec/module_spec.rb
roda-cj-1.0.1 spec/module_spec.rb
roda-cj-1.0.0 spec/module_spec.rb
roda-1.0.0 spec/module_spec.rb
roda-cj-0.9.6 spec/module_spec.rb
roda-cj-0.9.5 spec/module_spec.rb
roda-cj-0.9.4 spec/module_spec.rb
roda-cj-0.9.3 spec/module_spec.rb
roda-cj-0.9.2 spec/module_spec.rb
roda-cj-0.9.1 spec/module_spec.rb
roda-0.9.0 spec/module_spec.rb