<commit_before>#!/usr/bin/env ruby

BEGIN {
	require 'pathname'
	basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
	
	libdir = basedir + "lib"
	
	$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
}

begin
	require 'spec/runner'
	require 'rdoc/generator/darkfish'
rescue LoadError
	unless Object.const_defined?( :Gem )
		require 'rubygems'
		retry
	end
	raise
end


describe RDoc::Generator::Darkfish do

	it "can create an instance via the generator factory method" do
		RDoc::Generator::Darkfish.for( 'darkfish' ).
			should be_an_instance_of( RDoc::Generator::Darkfish )
	end
	

	describe "an instance" do
		
		before( :each ) do
			$dryrun = true
			@options = RDoc::Options.new( RDoc::RDoc::GENERATORS )
			@generator = RDoc::Generator::Darkfish.for( @options )
		end
		
		
		it "generates the required subdirectories" do
			@generator.outputdir.should_receive( :mkpath )
			@generator.gen_sub_directories
		end
		
		
		it "copies static files over during #write_style_sheet" do
			FileUtils.should_receive( :cp_r ).
				with( an_instance_of(Pathname), '.', :verbose => $DEBUG, :noop => $dryrun ).
				exactly( 3 ).times
			@generator.write_style_sheet
		end
		
		it "adjusts to changes in RDoc 2.2.0 (::build_indices vs. ::build_indicies)" do<commit_msg>Fixed broken expectation setup.<commit_after>#!/usr/bin/env ruby

BEGIN {
	require 'pathname'
	basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
	
	libdir = basedir + "lib"
	
	$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
}

begin
	require 'spec/runner'
	require 'rdoc/generator/darkfish'
rescue LoadError
	unless Object.const_defined?( :Gem )
		require 'rubygems'
		retry
	end
	raise
end


describe RDoc::Generator::Darkfish do

	it "can create an instance via the generator factory method" do
		RDoc::Generator::Darkfish.for( 'darkfish' ).
			should be_an_instance_of( RDoc::Generator::Darkfish )
	end
	

	describe "an instance" do
		
		before( :each ) do
			$dryrun = true
			@options = RDoc::Options.new( RDoc::RDoc::GENERATORS )
			@generator = RDoc::Generator::Darkfish.for( @options )
		end
		
		
		it "generates the required subdirectories" do
			outputdir = mock( "mock outputdir" )
			outputdir.should_receive( :mkpath )
			
			@generator.instance_variable_set( :@outputdir, outputdir )
			@generator.gen_sub_directories
		end
		
		
		it "copies static files over during #write_style_sheet" do
			FileUtils.should_receive( :cp_r ).
				with( an_instance_of(Pathname), '.', :verbose => $DEBUG, :noop => $dryrun ).
				exactly( 3 ).times
			@generator.write_style_sheet
		end
		
		it "adjusts to changes in RDoc 2.2.0 (::build_indices vs. ::build_indicies)" do
{'fraction_non_alphanumeric': 0.115570419918246, 'fraction_numerical': 0.0029728725380899295, 'mean_word_length': 4.013035381750465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6702607', 'n_tokens_mistral': 1045, 'n_tokens_neox': 907, 'n_words': 231}