Sha256: 5dd5f70d1ca879a19cc3b8b0758e994a922c3934ccdfb2e717fbc78140282b87

Contents?: true

Size: 1014 Bytes

Versions: 3

Compression:

Stored size: 1014 Bytes

Contents

require 'test/unit'
require 'external/test_support'
IWATestSupport.set_src_dir
require 'iowa'

class MyApp < Iowa::Application; end
class MyComp < Iowa::DetachedComponent
	def awake
		self.class.template = "This is a test.  The time now is: @the_time."
	end

	def the_time
		Time.now.asctime
	end
end

class TC_SimpleDetached < Test::Unit::TestCase
	# init instance vars

	@@testdir = IWATestSupport.test_dir(__FILE__)
	def setup
		Dir.chdir(@@testdir)
		IWATestSupport.announce(:simple_detached,"Simple Detached Component")
		assert_nothing_raised("setup failed") do
			ARGV.push(nil)
			@context = Iowa::Context.new
		end
	end

	def test_simple_detached
		assert_nothing_raised("Failure while testing simple detached component.") do
			component = MyComp.new('mycomp',[],[],nil)
			response = component.handleResponse(@context,true)
			puts response.inspect
			assert(response.body =~ /^This is a test.  The time now is: /,"The response from the detached component was not what was expected.")
		end
	end

end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
IOWA-1.0.3 test/TC_SimpleDetached.rb
IOWA-1.0.2 test/TC_SimpleDetached.rb
IOWA-1.0.0 test/TC_SimpleDetached.rb