Skip to content

Commit

Permalink
[spec] make it possible to use base check as a stub
Browse files Browse the repository at this point in the history
we need a check method, and we add it to possible watchers you can request
  • Loading branch information
igor47 committed Jan 16, 2015
1 parent 3b06553 commit 6e043d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/nerve/service_watcher/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def catch_errors(&block)
end
end
end

CHECKS ||= {}
CHECKS['base'] = BaseServiceCheck
end
end

2 changes: 1 addition & 1 deletion spec/factories/check.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryGirl.define do
factory :check, :class => Hash do
type 'tcp'
type 'base'
timeout 0.2
rise 3
fall 2
Expand Down
2 changes: 2 additions & 0 deletions spec/factories/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
instance_id 'public_hostname.example.com'
host 'localhost'
port 3000
reporter_type 'base'
checks { create_list(:check, checks_count) }
check_interval nil

trait :zookeeper do
reporter_type 'zookeeper'
Expand Down

0 comments on commit 6e043d9

Please sign in to comment.