aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mauve/heartbeat.rb10
-rw-r--r--lib/mauve/server.rb1
-rw-r--r--test/tc_mauve_heartbeat.rb20
3 files changed, 26 insertions, 5 deletions
diff --git a/lib/mauve/heartbeat.rb b/lib/mauve/heartbeat.rb
index 11f4d5b..d07e6fc 100644
--- a/lib/mauve/heartbeat.rb
+++ b/lib/mauve/heartbeat.rb
@@ -35,7 +35,7 @@ module Mauve
# @param [Integer] i Seconds
# @return [Integer] Seconds
def raise_after=(i)
- raise ArgumentError "raise_after must be an integer" unless i.is_a?(Integer)
+ raise ArgumentError, "raise_after must be an integer" unless i.is_a?(Integer)
@raise_after = i
end
@@ -44,7 +44,7 @@ module Mauve
# @param [Integer] i Seconds
# @return [Integer] Seconds
def send_every=(i)
- raise ArgumentError "send_every must be an integer" unless i.is_a?(Integer)
+ raise ArgumentError, "send_every must be an integer" unless i.is_a?(Integer)
@send_every = i
end
@@ -54,7 +54,7 @@ module Mauve
#
# @param [String] s Summary
def summary=(s)
- raise ArgumentError "summary must be a string" unless s.is_a?(String)
+ raise ArgumentError, "summary must be a string" unless s.is_a?(String)
@summary = s
end
@@ -62,7 +62,7 @@ module Mauve
#
# @param [String] d Detail
def detail=(d)
- raise ArgumentError "detail must be a string" unless d.is_a?(String)
+ raise ArgumentError, "detail must be a string" unless d.is_a?(String)
@detail = d
end
@@ -71,7 +71,7 @@ module Mauve
# @param [String] d Destination
#
def destination=(d)
- raise ArgumentError "destination must be a string" unless d.is_a?(String)
+ raise ArgumentError, "destination must be a string" unless d.is_a?(String)
@destination = d
end
diff --git a/lib/mauve/server.rb b/lib/mauve/server.rb
index a212695..9745c28 100644
--- a/lib/mauve/server.rb
+++ b/lib/mauve/server.rb
@@ -163,6 +163,7 @@ module Mauve
#
DataMapper::Model.descendants.each do |m|
next if m == AlertEarliestDate
+ c = m.to_s.split("::").last
next unless m.respond_to?("auto_upgrade!")
m.auto_upgrade!
#
diff --git a/test/tc_mauve_heartbeat.rb b/test/tc_mauve_heartbeat.rb
new file mode 100644
index 0000000..5406e3c
--- /dev/null
+++ b/test/tc_mauve_heartbeat.rb
@@ -0,0 +1,20 @@
+# encoding: utf-8
+
+$:.unshift "../lib"
+
+require 'th_mauve'
+require 'th_mauve_resolv'
+require 'mauve/server'
+require 'mauve/heartbeat'
+
+class TcMauveHeartbeat < Mauve::UnitTest
+ include Mauve
+
+ def test_errors_on_bad_destination
+ heartbeat = Heartbeat.instance
+ assert_raises(ArgumentError) do
+ heartbeat.destination = 1
+ end
+ end
+end
+