Sha256: 0aa0b9af5f3eeaafe1a736b93825d814ffbea1e920d1a243872134fa6f225100
Contents?: true
Size: 969 Bytes
Versions: 4
Compression:
Stored size: 969 Bytes
Contents
require 'test_helper' class ApotomoCachingTest < Test::Unit::TestCase include Apotomo::UnitTestCase def setup super @controller.session= {} @cc = CachingCell.new('caching_cell', :start) @cc.controller = @controller end def test_caching_with_instance_version_proc unless ActionController::Base.cache_configured? throw Exception.new "cache_configured? returned false. You may enable caching in your config/environments/test.rb to make this test pass." return end c1 = @cc.invoke c2 = @cc.invoke assert_equal c1, c2 @cc.dirty! c3 = @cc.invoke assert c2 != c3 end end class CachingCell < Apotomo::StatefulWidget cache :cached_state transition :in => :cached_state def start jump_to_state :cached_state end def cached_state @counter ||= 0 @counter += 1 "#{@counter}" end def not_cached_state "i'm really static" end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
apotomo-1.0.0.beta2 | test/unit/test_caching.rb |
apotomo-1.0.0.beta1 | test/unit/test_caching.rb |
apotomo-0.1.4 | test/unit/test_caching.rb |
apotomo-0.1.3 | test/unit/test_caching.rb |