Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

updated api port validation, there is now a default value (4567) #9

Merged
merged 1 commit into from
Apr 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/sensu/settings/validators/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def validate_api_authentication(api)
# @param api [Hash] sensu api definition.
def validate_api(api)
if is_a_hash?(api)
must_be_an_integer(api[:port]) ||
must_be_an_integer_if_set(api[:port]) ||
invalid(api, "api port must be an integer")
must_be_a_string_if_set(api[:bind]) ||
invalid(api, "api bind must be a string")
Expand Down
2 changes: 1 addition & 1 deletion spec/validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@
expect(@validator.reset).to eq(1)
api = {}
@validator.validate_api(api)
expect(@validator.reset).to eq(1)
expect(@validator.reset).to eq(0)
api[:port] = true
@validator.validate_api(api)
expect(@validator.reset).to eq(1)
Expand Down