- What’s a good way to measure an application’s memory usage (beyond top)? Ideally, this would provide summarized information (rather than a lot of raw data like Linux’s /proc/pid/maps).
I just released Cacheable Flash 0.1.4. This version includes test helpers so you can easily test your cache messages. It works by allowing you to make assertions on the flash cookie.
Here is a test/unit example:
require "cacheable_flash/test_helpers" class TestController < ActionController::Base def index flash["notice"] = "In index" end end class ControllerTest < Test::Unit::TestCase include CacheableFlash::TestHelpers def setup @controller = TestController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end def test_cacheable_flash_action get :index asset_equal "In index", flash_cookie["notice"] end end
Here is a rspec example:
require "cacheable_flash/test_helpers" class TestController < ActionController::Base def index flash["notice"] = "In index" end end describe TestController, "#index" do include CacheableFlash::TestHelpers it "writes to the flash cookie" do get :index flash_cookie["notice"].should == "In index" end end
You can install Cacheable Flash by running:
ruby script/plugin install svn://rubyforge.org/var/svn/pivotalrb/cacheable_flash/trunk