<commit_before># encoding: utf-8

require 'logger'
require 'socket'
require 'girl_friday'
require 'redis'
require 'active_support/core_ext/object'
require 'active_support/json/encoding'

require 'rollbar/item'
require 'ostruct'

begin
  require 'rollbar/delay/sidekiq'
  require 'rollbar/delay/sucker_punch'
rescue LoadError
end

begin
  require 'sucker_punch'
  require 'sucker_punch/testing/inline'
rescue LoadError
end

begin
  require 'rollbar/delay/shoryuken'
rescue LoadError
end

require 'spec_helper'

describe Rollbar do
  let(:notifier) { Rollbar.notifier }

  before do
    Rollbar.clear_notifier!
    configure
  end

  context 'when notifier has been used before configure it' do
    before do
      Rollbar.clear_notifier!
    end

    it 'is finally reset' do
      Rollbar.log_debug('Testing notifier')
      expect(Rollbar.error('error message')).to be_eql('disabled')

      reconfigure_notifier

      expect(Rollbar.error('error message')).not_to be_eql('disabled')
    end
  end
<commit_msg>allow spec/rollbar_spec.rb to run in isolation (fix dependency order)<commit_after># encoding: utf-8

require 'logger'
require 'socket'
require 'girl_friday'
require 'redis'
require 'active_support/core_ext/object'
require 'active_support/json/encoding'

require 'rollbar/item'
require 'ostruct'

require 'spec_helper'

begin
  require 'rollbar/delay/sidekiq'
  require 'rollbar/delay/sucker_punch'
rescue LoadError
end

begin
  require 'sucker_punch'
  require 'sucker_punch/testing/inline'
rescue LoadError
end

begin
  require 'rollbar/delay/shoryuken'
rescue LoadError
end

describe Rollbar do
  let(:notifier) { Rollbar.notifier }

  before do
    Rollbar.clear_notifier!
    configure
  end

  context 'when notifier has been used before configure it' do
    before do
      Rollbar.clear_notifier!
    end

    it 'is finally reset' do
      Rollbar.log_debug('Testing notifier')
      expect(Rollbar.error('error message')).to be_eql('disabled')

      reconfigure_notifier

      expect(Rollbar.error('error message')).not_to be_eql('disabled')
    end
  end

{'fraction_non_alphanumeric': 0.08846153846153847, 'fraction_numerical': 0.0009615384615384616, 'mean_word_length': 4.241813602015113, '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': '5355272', 'n_tokens_mistral': 694, 'n_tokens_neox': 684, 'n_words': 174}