1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

don't worry about this for now

This commit is contained in:
blake.mizerany@gmail.com 2007-09-12 23:44:13 +00:00
parent 0302501212
commit f5c532306e
3 changed files with 0 additions and 43 deletions

View file

@ -1,3 +0,0 @@
require File.dirname(__FILE__) + '/lib/responder'
Sinatra::EventContext.send(:include, Sinatra::Responder)

View file

@ -1,27 +0,0 @@
module Sinatra
module Responder
def self.included(parent)
parent.send(:include, InstanceMethods)
end
class ResponderContext
def initialize(format)
@format = format
end
def method_missing(name, *args)
yield if name.to_s == @format
end
end
module InstanceMethods
def format
@responder_context ||= ResponderContext.new(params[:format])
end
end
end
end

View file

@ -1,13 +0,0 @@
require File.dirname(__FILE__) + '/../../../test/helper'
context "A responder, by default" do
specify "should default to html" do
path = '/foo/test.xml'
context = Sinatra::EventContext.new(stub(:params => { :format => 'xml' }))
context.expects(:foo)
context.instance_eval do
format.xml { foo }
format.html { bar }
end
end
end