-
Notifications
You must be signed in to change notification settings - Fork 120
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 #294 from riemann/add-minimum-ttl
Add support for a minimum TTL for events
- Loading branch information
Showing
2 changed files
with
38 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,32 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'riemann/tools/health' | ||
|
||
class ExampleTool | ||
include Riemann::Tools | ||
end | ||
|
||
RSpec.describe Riemann::Tools do | ||
describe '#options' do | ||
describe ':ttl' do | ||
subject(:tool) { ExampleTool.new } | ||
|
||
{ | ||
'' => 10, | ||
'--ttl=60' => 60, | ||
'--interval 10' => 20, | ||
'--minimum-ttl 300' => 300, | ||
'--minimum-ttl 300 --ttl=60' => 300, | ||
'--minimum-ttl 30 --ttl 60' => 60, | ||
}.each do |argv, expected_ttl| | ||
context "with ARGV=\"#{argv}\"" do | ||
before do | ||
ARGV.replace argv.split | ||
end | ||
|
||
it { expect(tool.options[:ttl]).to eq expected_ttl } | ||
end | ||
end | ||
end | ||
end | ||
end |