Skip to content

Instantly share code, notes, and snippets.

class User < Sinatra::Base
map "/users"
get "/" do
end
post "/" do
end
(in /home/btakita/workspace/ramaze)
1/90: spec/contrib/rest.rb  5 passed
2/90: spec/examples/templates/template_remarkably.rb  3 passed
3/90: spec/examples/templates/template_liquid.rb  3 passed
4/90: spec/examples/templates/template_markaby.rb  needed Ramaze::View::Markaby
5/90: spec/examples/templates/template_redcloth.rb  3 passed
6/90: spec/examples/templates/template_haml.rb  3 passed
7/90: spec/examples/templates/template_nagoro.rb  3 passed
8/90: spec/examples/templates/template_tenjin.rb  3 passed
9/90: spec/examples/templates/template_erubis.rb  3 passed
require 'rubygems'
require 'ramaze'
require 'rack/test'
require 'spec'
require 'spec/autorun'
require 'rr'
Spec::Runner.configure do |config|
config.mock_with :rr
end
#!/bin/sh
# do something like this to run jsunit tests on osx (safari)
# cd ~/.cruise/projects/Sandbox/work
# svn up
# rake jsunit:start_servant
#Don't need this until we want to test IE
#open ~/Documents/Parallels/winxp.pvm
class Daemon
def initialize(run_now = true)
run if run_now
end
def run
raise "dont call me"
# loop do
# puts "running!"
require "rubygems"
require "spec"
require "spec/autorun"
require "spec/interop/test"
require "activesupport"
require "shoulda"
describe "Something" do
def test_something
puts "in test_something"
class SiteWidget < Erector::Widget
class << self
def tag(name, value=nil, &implentation)
raise(ArgumentError, "You cannot have both a value and an implentation") if value && implentation
if implentation
define_method(name, &implentation)
else
define_method(name) {value}
end
end
module ActionController::Integration::Runner
# TODO: Make this a rails patch
def method_missing(sym, *args, &block)
reset! unless @integration_session
if @integration_session.respond_to?(sym)
returning @integration_session.__send__(sym, *args, &block) do
copy_session_variables!
end
else
super
class ApplicationController < ActionController::Base
protected
def update_page(callback_base_name = @action_name, &block)
callback_name = "on_#{callback_base_name}"
render :update do |page|
args = block ? instance_eval(&block) : []
args = [args] unless args.is_a?(Array)
page << "page.#{callback_name}.apply(page, #{args.to_json})"
end
end
# TODO: BT - Remove this when this is integrated into RR.
#Adding this monkey patch to get around issue with Double R and named scopes
RR::DoubleInjection.class_eval do
def initialize(subject, method_name)
@subject = subject
@method_name = method_name.to_sym
if object_has_method?(method_name)
begin
meta.__send__(:alias_method, original_method_name, method_name)
rescue NameError => e