Sha256: 8b7deb35216593f0fa362481c6133029623023928d7650fe202aab3f6d0bcdac

Contents?: true

Size: 551 Bytes

Versions: 2

Compression:

Stored size: 551 Bytes

Contents

require File.join(File.dirname(__FILE__), 'CONFIG.rb')

require 'test/unit'

require 'nitro'

class TestControllerAspect < Test::Unit::TestCase # :nodoc: all
  include Nitro
  
  class TestController < Controller
    attr_reader :aflag, :tflag

    @template_root = []

    post "@aflag = 25", :on => :list
    
    def list
      @aflag = 3
    end
  end
  
  def test_aspect
    ctx = Context.new(Server.new)
    ctx.instance_variable_set '@session', {}
    c = TestController.new(ctx)
    c.list_action
    
    assert_equal 25, c.aflag
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nitro-0.30.0 test/nitro/tc_controller_aspect.rb
nitro-0.31.0 test/nitro/tc_controller_aspect.rb