Sha256: 750678886d78ce8d408820956bf1a60bce9c667ced14f509ad93b06091209dd9

Contents?: true

Size: 649 Bytes

Versions: 5

Compression:

Stored size: 649 Bytes

Contents

require "test/unit"

require "nitro/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

5 entries across 5 versions & 1 rubygems

Version Path
nitro-0.4.1 test/n/server/tc_filters.rb
nitro-0.5.0 test/nitro/server/tc_filters.rb
nitro-0.6.0 test/nitro/server/tc_filters.rb
nitro-0.7.0 test/nitro/server/tc_filters.rb
nitro-0.8.0 test/nitro/server/tc_filters.rb