<commit_before># Setup testing
require 'spec_helper'
require 'rails'
describe GollumRails::Setup do
  it "should setup the application" do
    GollumRails::Setup.build do |setup|

      # => The repository path to the 
      #
      #
      setup.repository = '.'      

      #setup.wiki.use = :default
      setup.startup=(true).should be_true

      setup.repository = nil
      expect{setup.startup=true}.to raise_error GollumRails::GollumInternalError

    end


  end
  class Bla < GollumRails::Page
  end
  it "should test the disable behavior" do
    GollumRails::Adapters::Gollum::Connector.enabled = false

    committer = {
          :name => "Flo",
          :message => "no",
          :email => "<EMAIL>"
        }

    expect{Bla.new :name => "Default page", :commit => committer, :content => "#title \n ##body", :format => :markdown}.to raise_error GollumRails::GollumInternalError
  end
  it "should test the applications config" do
    GollumRails::Setup.build do |config|
      config.repository = :application

      expect{setup.startup=true}.to raise_error
    end
  end
  it "should throw an error if a pathname was supplied that does not exist" do
    GollumRails::Setup.build do |setup|
      setup.repository = Pathname.new('/nonexistingdirectoryshouldbenonexisting') 
      expect{setup.startup=(true)}.to raise_error(GollumRails::GollumInternalError)
    end
  end
  it "should test the Rails configuration" do
    GollumRails::Setup.build do |setup|

      # => The repository path to the 
      #
      #
      setup.repository = :application    

      #setup.wiki.use = :default
      expect{setup.startup=(true)}.to raise_error(NoMethodError, "undefined method `config' for nil:NilClass")

      #setup.repository = nil
      #expect{setup.startup=true}.to raise_error GollumRails::GollumInternalError

    end
  end

end<commit_msg>changed to new init behavior<commit_after># Setup testing
require 'spec_helper'
require 'rails'
describe GollumRails::Setup do
  it "should setup the application" do
    expect{
      GollumRails::Setup.build do |setup|

        # => The repository path to the 
        #
        #
        setup.repository = '.'      

      end
    }.not_to raise_error
    


  end
  it "should raise an error because no repo was supplied" do
    expect{
      GollumRails::Setup.build do |setup|
        setup.repository = nil     

      end
    }.to raise_error
  end
  class Bla < GollumRails::Page
  end
  it "should test the disable behavior" do
    GollumRails::Adapters::Gollum::Connector.enabled = false

    committer = {
          :name => "Flo",
          :message => "no",
          :email => "<EMAIL>"
        }

    expect{Bla.new :name => "Default page", :commit => committer, :content => "#title \n ##body", :format => :markdown}.to raise_error GollumRails::GollumInternalError
  end
  it "could not start without a rails configuration" do
    
    expect {
      GollumRails::Setup.build do |config|
        config.repository = :application

      end
    }.to raise_error GollumRails::GollumRailsSetupError
    
  end
  it "should throw an error if a pathname was supplied that does not exist" do
    expect{
      GollumRails::Setup.build do |setup|
        setup.repository = Pathname.new('/nonexistingdirectoryshouldbenonexisting') 
      end
    }.to raise_error GollumRails::GollumRailsSetupError
  end


end
{'fraction_non_alphanumeric': 0.10047281323877069, 'fraction_numerical': 0.0, 'mean_word_length': 2.824858757062147, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, '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': '2623742', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1026, 'n_words': 281}