<commit_before>require "spec_helper"

module Risu
	module Parsers
		module Nessus
			describe NessusDocument do
				before(:all) do
					@doc = NessusDocument.new "test_data/nessus_report_local.nessus"
					@fail_doc = NessusDocument.new "test_data/fail.nessus"
					@invalid_doc = NessusDocument.new "test_data/invalid_report.nessus"
				end
		
				after(:all) do
					Report.delete_all
					Host.delete_all
					Plugin.delete_all
					Item.delete_all
					FamilySelection.delete_all
					IndividualPluginSelection.delete_all
					PluginsPreference.delete_all
					Policy.delete_all
					Reference.delete_all
					ServerPreference.delete_all
					Version.delete_all
				end
		
				it "should return true for NessusDocument.valid?" do				
					@doc.valid?.should == true
				end
		
				it "should return false for NessusDocument.valid? when the document doesn't exist" do
					@fail_doc.valid?.should == false
				end
		
				it "should return false for NessusDocument.valid? when the document is invalid" do
					@invalid_doc.valid?.should == false
				end
		
				it "should return true for NessusDocument.parse" do				
					@doc.parse.should == true
				end
				
				# @todo implement this
				it "should return true for NessusDocument.fix_ips" do				
					@doc.valid?.should == true
				end
			end
		end
	end
end<commit_msg>Added a note to update this later during the spec phase<commit_after>require "spec_helper"

module Risu
	module Parsers
		module Nessus
			describe NessusDocument do
				before(:all) do
					@doc = NessusDocument.new "test_data/nessus_report_local.nessus"
					@fail_doc = NessusDocument.new "test_data/fail.nessus"
					@invalid_doc = NessusDocument.new "test_data/invalid_report.nessus"
				end
		
				after(:all) do
					Report.delete_all
					Host.delete_all
					Plugin.delete_all
					Item.delete_all
					FamilySelection.delete_all
					IndividualPluginSelection.delete_all
					PluginsPreference.delete_all
					Policy.delete_all
					Reference.delete_all
					ServerPreference.delete_all
					Version.delete_all
				end
		
				it "should return true for NessusDocument.valid?" do				
					@doc.valid?.should == true
				end
		
				it "should return false for NessusDocument.valid? when the document doesn't exist" do
					@fail_doc.valid?.should == false
				end
		
				it "should return false for NessusDocument.valid? when the document is invalid" do
					@invalid_doc.valid?.should == false
				end
		
				it "should return true for NessusDocument.parse" do				
					@doc.parse.should == true
				end
				
				# @todo implement this correctly and cal fix_ips
				it "should return true for NessusDocument.fix_ips" do				
					@doc.valid?.should == true
				end
			end
		end
	end
end
{'fraction_non_alphanumeric': 0.06838235294117648, 'fraction_numerical': 0.0, 'mean_word_length': 2.837799717912553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '896163', 'n_tokens_mistral': 1143, 'n_tokens_neox': 834, 'n_words': 221}