Sha256: 46c5eeb012b2a0a0d5d5116db591f40e7bc0d96e6b02735c37c11ddcc3396404

Contents?: true

Size: 544 Bytes

Versions: 28

Compression:

Stored size: 544 Bytes

Contents

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

describe "delegate plugin" do 
  it "adds request_delegate and response_delegate class methods for delegating" do
    app(:bare) do 
      plugin :delegate
      request_delegate :root
      response_delegate :headers

      def self.a; 'foo'; end
      class_delegate :a

      route do
        root do
          headers['Content-Type'] = a
        end
      end
    end
    
    header('Content-Type').must_equal 'foo'
    status('/foo').must_equal 404
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
roda-2.29.0 spec/plugin/delegate_spec.rb
roda-2.28.0 spec/plugin/delegate_spec.rb
roda-2.27.0 spec/plugin/delegate_spec.rb
roda-2.26.0 spec/plugin/delegate_spec.rb
roda-2.25.0 spec/plugin/delegate_spec.rb
roda-2.24.0 spec/plugin/delegate_spec.rb
roda-2.23.0 spec/plugin/delegate_spec.rb
roda-2.22.0 spec/plugin/delegate_spec.rb
roda-2.21.0 spec/plugin/delegate_spec.rb
roda-2.20.0 spec/plugin/delegate_spec.rb
roda-2.19.0 spec/plugin/delegate_spec.rb
roda-2.18.0 spec/plugin/delegate_spec.rb
roda-2.17.0 spec/plugin/delegate_spec.rb
roda-2.16.0 spec/plugin/delegate_spec.rb
roda-2.15.0 spec/plugin/delegate_spec.rb
roda-2.14.0 spec/plugin/delegate_spec.rb
roda-2.13.0 spec/plugin/delegate_spec.rb
roda-2.12.0 spec/plugin/delegate_spec.rb
roda-2.11.0 spec/plugin/delegate_spec.rb
roda-2.10.0 spec/plugin/delegate_spec.rb