<commit_before>#!/usr/bin/ruby -w
#
# Unit test for the Arrow::FormValidator class
# $Id$
#
# Copyright (c) 2004, 2005 RubyCrafters, LLC. Most rights reserved.
# 
# This work is licensed under the Creative Commons Attribution-ShareAlike
# License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-sa/1.0/ or send a letter to Creative
# Commons, 559 <NAME>, Stanford, California 94305, USA.
#
# 

unless defined? Arrow::TestCase
	testsdir = File::dirname( File::expand_path(__FILE__) )
	basedir = File::dirname( testsdir )
	$LOAD_PATH.unshift "#{basedir}/lib" unless
		$LOAD_PATH.include?( "#{basedir}/lib" )
	$LOAD_PATH.unshift "#{basedir}/tests/lib" unless
		$LOAD_PATH.include?( "#{basedir}/tests/lib" )

	require 'arrowtestcase'
end


### Collection of tests for the Arrow::FormValidator class.
class Arrow::FormValidatorTestCase < Arrow::TestCase

	TestProfile = {
		:required		=> [ :required ],
		:optional		=> %w{optional number alpha},
		:descriptions	=> {
			:required		=> "Required Field",
			:numeric		=> "Numeric Field",
		},
		:constraints	=> {
			:number	=> /^(\d+)$/,
			:alpha	=> /^(\w+)$/,
		},
		:untaint_all_constraints => true
	}


	#################################################################
	###	T E S T S
	#################################################################

	# Simple instantiation
	def test_00_Instantiate
		printTestHeader "FormValidator: Instantiate"
		obj = rval = nil

		assert_nothing_raised do
			obj = Arrow::FormValidator::new<commit_msg>- Removed extemporaneous description section from test profile.<commit_after>#!/usr/bin/ruby -w
#
# Unit test for the Arrow::FormValidator class
# $Id$
#
# Copyright (c) 2004, 2005 RubyCrafters, LLC. Most rights reserved.
# 
# This work is licensed under the Creative Commons Attribution-ShareAlike
# License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-sa/1.0/ or send a letter to Creative
# Commons, 559 <NAME>, Stanford, California 94305, USA.
#
# 

unless defined? Arrow::TestCase
	testsdir = File::dirname( File::expand_path(__FILE__) )
	basedir = File::dirname( testsdir )
	$LOAD_PATH.unshift "#{basedir}/lib" unless
		$LOAD_PATH.include?( "#{basedir}/lib" )
	$LOAD_PATH.unshift "#{basedir}/tests/lib" unless
		$LOAD_PATH.include?( "#{basedir}/tests/lib" )

	require 'arrowtestcase'
end


### Collection of tests for the Arrow::FormValidator class.
class Arrow::FormValidatorTestCase < Arrow::TestCase

	TestProfile = {
		:required		=> [ :required ],
		:optional		=> %w{optional number alpha},
		:constraints	=> {
			:number	=> /^(\d+)$/,
			:alpha	=> /^(\w+)$/,
		},
		:untaint_all_constraints => true
	}


	#################################################################
	###	T E S T S
	#################################################################

	# Simple instantiation
	def test_00_Instantiate
		printTestHeader "FormValidator: Instantiate"
		obj = rval = nil

		assert_nothing_raised do
			obj = Arrow::FormValidator::new
{'fraction_non_alphanumeric': 0.21695594125500667, 'fraction_numerical': 0.01335113484646195, 'mean_word_length': 4.763461538461539, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1854206', 'n_tokens_mistral': 1039, 'n_tokens_neox': 920, 'n_words': 243}