Sha256: df5b95a2fc1520938a16bf6b0487404d45b2142a9814594f5bb57868b24a61e1

Contents?: true

Size: 645 Bytes

Versions: 1

Compression:

Stored size: 645 Bytes

Contents

require "test/unit"

require "n/server/filters"

class Filter1 < N::ServerFilter
	# :nodoc: all
	def process(request)
		return "filter1:#{process_next(request)}"
	end
end

class Filter2 < ServerFilter
	# :nodoc: all
	def process(request)
		return "filter2:#{process_next(request)}"
	end
end

class TC_Server_Filter < Test::Unit::TestCase
	# :nodoc: all

	def setup
		@filter = Filter1.new(Filter2.new)
	end

	def teardown
		@filter = nil
	end

	def test_process_next
		@filter = Filter1.new
		assert_equal("filter1:", @filter.process(nil))

		@filter = Filter1.new(Filter2.new)
		assert_equal("filter1:filter2:", @filter.process(nil))
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.3.0 test/n/server/tc_filters.rb