<commit_before>require 'spec_helper'
require 'bugsnag'

class BugsnagTestException < RuntimeError; end

def get_exception_from_payload(payload)
  payload[:events].count.should be == 1
  payload[:events].first[:exceptions].count.should be == 1
  
  payload[:events].first[:exceptions].last
end

describe Bugsnag::Notification do
  before(:each) do
    Bugsnag.configure do |config|
      config.api_key = "fake_api_key"
    end
  end

  it "should have the right exception class" do
    Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
      exception = get_exception_from_payload(payload)
      exception[:errorClass].should be == "BugsnagTestException"
    end
    
    Bugsnag.notify(BugsnagTestException.new("It crashed"))
  end

  it "should have the right exception message" do
    Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
      exception = get_exception_from_payload(payload)
      exception[:message].should be == "It crashed"
    end
    
    Bugsnag.notify(BugsnagTestException.new("It crashed"))
  end

  it "should have a valid stacktrace" do

  end

  it "should accept hash overrides and add them to metadata" do

  end
  
  it "should accept non-hash overrides and add them to custom metadata" do

  end

  it "should accept meta_data in overrides and merge it into overrides" do

  end
  
  it "should accept a context in overrides" do

  end
  
  it "should accept a user_id in overrides" do

  end
  
  it "should not send a notification if auto_notify is false" do

  end

  it "should contain a release_stage" do

  end

  it "should respect the notify_release_stages setting" do

  end

  it "should use ssl when use_ssl is true" do

  end

  it "should mark the top-most stacktrace line as inProject if necessary" do

  end

  it "should add app_version to the payload if it is set" do

  end

  it "should filter params from all payload hashes if they are set in params_filters" do

  end

  it "should not notify if the exception class is in the default ignore_classes list" do

  end

  it "should not notify if the non-default exception class is added to the ignore_classes" do

  end
end<commit_msg>Bunch more test assertions<commit_after>require 'spec_helper'
require 'bugsnag'

class BugsnagTestException < RuntimeError; end

def get_exception_from_payload(payload)
  payload[:events].count.should be == 1
  payload[:events].first[:exceptions].count.should be == 1
  
  payload[:events].first[:exceptions].last
end

describe Bugsnag::Notification do
  before(:each) do
    Bugsnag.configure do |config|
      config.api_key = "fake_api_key"
    end
  end

  it "should have the right exception class" do
    Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
      exception = get_exception_from_payload(payload)
      exception[:errorClass].should be == "BugsnagTestException"
    end
    
    Bugsnag.notify(BugsnagTestException.new("It crashed"))
  end

  it "should have the right exception message" do
    Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload|
      exception = get_exception_from_payload(payload)
      exception[:message].should be == "It crashed"
    end
    
    Bugsnag.notify(BugsnagTestException.new("It crashed"))
  end

  it "should have a valid stacktrace" do
    raise "fail"
  end

  it "should accept hash overrides and add them to metadata" do
    raise "fail"
  end
  
  it "should accept non-hash overrides and add them to custom metadata" do
    raise "fail"
  end

  it "should accept meta_data in overrides and merge it into overrides" do
    raise "fail"
  end
  
  it "should accept a context in overrides" do
    raise "fail"
  end
  
  it "should accept a user_id in overrides" do
    raise "fail"
  end
  
  it "should not send a notification if auto_notify is false" do
    raise "fail"
  end

  it "should contain a release_stage" do
    raise "fail"
  end

  it "should respect the notify_release_stages setting" do
    raise "fail"
  end

  it "should use ssl when use_ssl is true" do
    raise "fail"
  end

  it "should mark the top-most stacktrace line as inProject if necessary" do
    raise "fail"
  end

  it "should add app_version to the payload if it is set" do
    raise "fail"
  end

  it "should filter params from all payload hashes if they are set in params_filters" do
    raise "fail"
  end

  it "should not notify if the exception class is in the default ignore_classes list" do
    raise "fail"
  end

  it "should not notify if the non-default exception class is added to the ignore_classes" do
    raise "fail"
  end
end
{'fraction_non_alphanumeric': 0.06716577540106952, 'fraction_numerical': 0.000855614973262032, 'mean_word_length': 3.570869990224829, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2941689', 'n_tokens_mistral': 1435, 'n_tokens_neox': 1376, 'n_words': 530}