Skip to content

Instantly share code, notes, and snippets.

context "logged out" do
setup { session[:user_id] = nil }
context "GET to index" do
setup { get :index }
should_redirect_to_root
end
context "GET to show" do
setup { get :show }
diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb
index e9b434d..31cbe27 100644
--- a/actionpack/lib/action_controller/caching/fragments.rb
+++ b/actionpack/lib/action_controller/caching/fragments.rb
@@ -26,32 +26,6 @@ module ActionController #:nodoc:
#
# expire_fragment(:controller => "topics", :action => "list", :action_suffix => "all_topics")
module Fragments
- def self.included(base) #:nodoc:
- base.class_eval do
#!/usr/local/bin/ruby
require 'lsapi'
class CodeCache
def [](filename)
mtime = File.mtime( filename )
entry = @cache[filename];
if entry != nil
def test_write_attributes_respect_access_control_exception_message
privatize("title=(value)")
topic = @target.new
topic.title = "Pants"
assert false, "topic.title should raise NoMethodError exception"
rescue NoMethodError => e
assert_equal e.message, "Attempt to call private method"
end
[21:45] lifo: some more duplications in your script :
[21:45] lifo: Catfish, catfish, Jonathan del Strother == all same
[21:46] lifo: Hampton Catlin, hcatlin ~ at ~ gmail.com
[21:46] lifo: Geoff Garside, ggarside
[21:47] lifo: Seth Rasmussen, loincloth
[21:47] lifo: Kamal Fariz Mahyuddin, kamal
[21:48] lifo: Tom Ward, Tom ward
[21:48] lifo: tomafro == Tom ward as well
[21:49] lifo: lazyatom, James Adam
[21:50] lifo: danger, Jack Danger Canty, Danger
ReinH, Rein Henrichs
Chris Wanstrath, defunkt
rails ~ at ~ tpope.info, Tim Pope, pope, Time Pope
Tom Ward, tom ~ at ~ popdog.net
Eric Hodel, Hodel
norbert, Norbert Crombach
RSL, rsl, Russell Norris
dchelimsky, David Chelimsky
wesley.moxam, wmoxam, Wesley Moxam
mpalmer, mpalmer ~ at ~ hezmatt.org
diff --git a/test/test_context.rb b/test/test_context.rb
index 625160d..442dfe4 100644
--- a/test/test_context.rb
+++ b/test/test_context.rb
@@ -54,4 +54,8 @@ class TestContext < Test::Unit::TestCase
end
end
end
+
+ def test_all_tests_get_run
GC::Profiler.clear
GC::Profiler.enable
a = Array.new(100000){ 'aa' }
puts GC::Profiler.result
__END__
GC 5 invokes.
Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)
require 'erb'
local_assigns = {:a => 10, :b => 20}
locals_code = local_assigns.keys.map { |key| "#{key} = local_assigns[:#{key}];" }.join
source = "<%= whatever_is_in_your_template %>"
compiled_source = ERB.new(source).src
method_name = 'derived_from_template_name_and_local_keys'
compiled_method_source = source = <<-end_src
def hello(local_assigns)
locals_code = local_assigns.keys.map { |key| "#{key} = local_assigns[:#{key}];" }.join
# what goes here
puts dynamic_local_var
end
hello :dynamic_local_var => 2