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.9.0 spec/plugin/delegate_spec.rb
roda-2.8.0 spec/plugin/delegate_spec.rb
roda-2.7.0 spec/plugin/delegate_spec.rb
roda-2.6.0 spec/plugin/delegate_spec.rb
roda-2.5.1 spec/plugin/delegate_spec.rb
roda-2.5.0 spec/plugin/delegate_spec.rb
roda-2.4.0 spec/plugin/delegate_spec.rb
roda-2.3.0 spec/plugin/delegate_spec.rb