<commit_before><cfcomponent extends="wheelsMapping.Test">

	<cfset params = {controller="test", action="test"}>
	<cfset loc.controller = controller("dummy", params)>
	
	<cffunction name="setup">
		<cfset args = StructNew()>
		<cfset args.$testingMode = true>
	</cffunction>
	
	<cffunction name="test_only_file_supplied">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>
	
	<cffunction name="test_file_and_name_supplied">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset args.name = "A Weird FileName.png">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "A Weird FileName.png"')>
	</cffunction>
	
	<cffunction name="test_change_disposition">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset args.disposition = "attachment">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.disposition eq "attachment"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>
	
	<cffunction name="test_overload_mimetype">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset args.type = "wheels/custom">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.disposition eq "attachment"')>
		<cfset assert('loc.r.mime eq "wheels/custom"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>
	
	<cffunction name="test_no_extension_one_file_exists">
		<cfset args.file = "../wheels/tests/_assets/files/sendFile">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "sendFile.txt"')>
		<cfset assert('loc.r.mime eq "text/plain"')>
		<cfset assert('loc.r.name eq "sendFile.txt"')>
	</cffunction>
	
	<cffunction name="test_no_extension_multiple_files_exists">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo">
		<cfset loc.r = raised("loc.controller.sendFile(argumentCollection=args)")>
		<cfset assert('loc.r eq "Wheels.FileNotFound"')>
	</cffunction>
	
	<cffunction name="test_specifying_a_directory">
		<cfset args.directory = expandPath("/wheelsMapping/tests/_assets")>
		<cfset args.file = "files/cfwheels-logo.png">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>

	<cffunction name="test_ram_resource">
		<cfdocument format="PDF" name="cfwheels_pdf"></cfdocument>
		<cffile action="write" file="ram://cfwheels.pdf" output="#cfwheels_pdf#"> 
		<cfset args.file = "ram://cfwheels.pdf">
		<cfset args.deleteFile=true><commit_msg>Fix failing test<commit_after><cfcomponent extends="wheelsMapping.Test">

	<cfset params = {controller="test", action="test"}>
	<cfset loc.controller = controller("dummy", params)>
	
	<cffunction name="setup">
		<cfset args = StructNew()>
		<cfset args.$testingMode = true>
	</cffunction>
	
	<cffunction name="test_only_file_supplied">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>
	
	<cffunction name="test_file_and_name_supplied">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset args.name = "A Weird FileName.png">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "A Weird FileName.png"')>
	</cffunction>
	
	<cffunction name="test_change_disposition">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset args.disposition = "attachment">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.disposition eq "attachment"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>
	
	<cffunction name="test_overload_mimetype">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo.png">
		<cfset args.type = "wheels/custom">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.disposition eq "attachment"')>
		<cfset assert('loc.r.mime eq "wheels/custom"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>
	
	<cffunction name="test_no_extension_one_file_exists">
		<cfset args.file = "../wheels/tests/_assets/files/sendFile">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "sendFile.txt"')>
		<cfset assert('loc.r.mime eq "text/plain"')>
		<cfset assert('loc.r.name eq "sendFile.txt"')>
	</cffunction>
	
	<cffunction name="test_no_extension_multiple_files_exists">
		<cfset args.file = "../wheels/tests/_assets/files/cfwheels-logo">
		<cfset loc.r = raised("loc.controller.sendFile(argumentCollection=args)")>
		<cfset assert('loc.r eq "Wheels.FileNotFound"')>
	</cffunction>
	
	<cffunction name="test_specifying_a_directory">
		<cfset args.directory = expandPath("/wheelsMapping/tests/_assets")>
		<cfset args.file = "files/cfwheels-logo.png">
		<cfset loc.r = loc.controller.sendFile(argumentCollection=args)>
		<cfset assert('loc.r.file eq "cfwheels-logo.png"')>
		<cfset assert('loc.r.mime eq "image/png"')>
		<cfset assert('loc.r.name eq "cfwheels-logo.png"')>
	</cffunction>

	<cffunction name="test_ram_resource">
		<cfdocument format="PDF" name="cfwheels_pdf"><p>Test</p></cfdocument>
		<cffile action="write" file="ram://cfwheels.pdf" output="#cfwheels_pdf#"> 
		<cfset args.file = "ram://cfwheels.pdf">
		<cfset args.deleteFile=true>
{'fraction_non_alphanumeric': 0.18079183420971234, 'fraction_numerical': 0.0, 'mean_word_length': 5.12405303030303, 'pattern_counts': {'":': 0, '<': 137, '<?xml version=': 0, '>': 137, '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': '5038644', 'n_tokens_mistral': 2574, 'n_tokens_neox': 2429, 'n_words': 393}