-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #556 from uroesch/monitoring_with_name
Adding with_name matcher to be_monitored_by
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
RSpec::Matchers.define :be_monitored_by do |monitor| | ||
match do |service| | ||
service.monitored_by?(monitor, @monitor_name) | ||
end | ||
description do | ||
if @monitor_name | ||
"be monitored by #{monitor} with name #{@monitor_name}" | ||
else | ||
"be monitored by #{monitor}" | ||
end | ||
end | ||
|
||
chain :with_name do |name| | ||
@monitor_name = (name ? name : nil) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters