Skip to content
Browse files

Fixed some Ruby 1.9 issues

  • Loading branch information...
1 parent 1ff0714 commit e757649d394e138e53bcbe023653e1c07d575b6a Joe Ferris committed Nov 5, 2009
Showing with 9 additions and 4 deletions.
  1. +1 −1 lib/hoptoad_notifier/notice.rb
  2. +6 −1 test/catcher_test.rb
  3. +1 −1 test/configuration_test.rb
  4. +1 −1 test/notice_test.rb
View
2 lib/hoptoad_notifier/notice.rb
@@ -106,7 +106,7 @@ def to_xml
notifier.url(notifier_url)
end
notice.error do |error|
- error.class(error_class)
+ error.tag!('class', error_class)
error.message(error_message)
error.backtrace do |backtrace|
self.backtrace.lines.each do |line|
View
7 test/catcher_test.rb
@@ -24,7 +24,12 @@ def build_controller_class(&definition)
def assert_sent_hash(hash, xpath)
hash.each do |key, value|
- assert_sent_element value.to_s, "#{xpath}/var[@key = '#{key}']"
+ element_xpath = "#{xpath}/var[@key = '#{key}']"
+ if value.respond_to?(:to_hash)
+ assert_sent_hash value.to_hash, element_xpath
+ else
+ assert_sent_element value.to_s, element_xpath
+ end
end
end
View
2 test/configuration_test.rb
@@ -165,7 +165,7 @@ def assert_config_overridable(option, value = 'a value')
def assert_appends_value(option, &block)
config = HoptoadNotifier::Configuration.new
original_values = config.send(option).dup
- block ||= lambda do
+ block ||= lambda do |config|
new_value = 'hello'
config.send(option) << new_value
new_value
View
2 test/notice_test.rb
@@ -256,7 +256,7 @@ def stub_request(attrs = {})
should "not ignore an exception not matching ignore filters" do
notice = build_notice(:error_class => 'ArgumentError',
:ignore => ['Argument'],
- :ignore_by_filters => [lambda { false }])
+ :ignore_by_filters => [lambda { |notice| false }])
assert !notice.ignore?
end

0 comments on commit e757649

Please sign in to comment.
Something went wrong with that request. Please try again.