test/helper.rb in airbrake-3.1.2 vs test/helper.rb in airbrake-3.1.3

- old
+ new

@@ -5,12 +5,10 @@ $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")) require 'thread' -require "bundler/setup" - require 'shoulda' require 'mocha' require 'action_controller' require 'action_controller/test_process' @@ -132,20 +130,10 @@ "/var/lib/gems/1.8/gems/airbrake-2.4.5/rails/init.rb:2:in `send_exception'"] opts = {:backtrace => backtrace}.merge(opts) BacktracedException.new(opts) end - class BacktracedException < Exception - attr_accessor :backtrace - def initialize(opts) - @backtrace = opts[:backtrace] - end - def set_backtrace(bt) - @backtrace = bt - end - end - def build_notice_data(exception = nil) exception ||= build_exception { :api_key => 'abc123', :error_class => exception.class.name, @@ -185,11 +173,11 @@ assert nodes.any?{|node| node.content == content }, "Expected xpath #{xpath} to have content #{content}, " + "but found #{nodes.map { |n| n.content }} in #{nodes.size} matching nodes." + "Document:\n#{document.to_s}" end - + def assert_logged(expected) assert_received(Airbrake, :write_verbose_log) do |expect| expect.with {|actual| actual =~ expected } end end @@ -198,11 +186,11 @@ assert_received(Airbrake, :write_verbose_log) do |expect| expect.with {|actual| actual =~ expected }.never end end - + end module DefinesConstants def setup @defined_constants = [] @@ -259,5 +247,17 @@ def warn(*args); end def error(*args); end def fatal(*args); end end +class BacktracedException < Exception + attr_accessor :backtrace + def initialize(opts) + @backtrace = opts[:backtrace] + end + def set_backtrace(bt) + @backtrace = bt + end + def message + "Something went wrong. Did you press the red button?" + end +end