sensu-settings 4.1.0 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08c4f5939688872fc9cfb94e3a4c42af084318c1
4
- data.tar.gz: 01b6875531d8db73bc2b835e74a731916be74ae6
3
+ metadata.gz: ec4eeffddb4f928ca7f35e4db5d455aa883d7569
4
+ data.tar.gz: 3dfcc2c5db1020a95919534e3fae558ae9a557a0
5
5
  SHA512:
6
- metadata.gz: 6e73354ccda29c9748589e941b279ac971c12f53826eff5c4e264016f4f4b968e0f0719a1ed3e525f68074547ee7ac18f878d99991d1a5451fbffcca47ee1d6f
7
- data.tar.gz: 75f9b0d366c0661f22ada4012082931bf8abd7321dcd0df81cc33eec835984c253cce2c8471f5b820b414e52441fb736bc7a6ac027d0db431c4629204a3f2cad
6
+ metadata.gz: 01aca6eb9d8281cfa44433f6a468ecf7a206fec2bf922171210016884e1fb47a039d7e2a84cff9d4d48fb6dfa29ac118387e326a7e6ae7e9d31b8943fee75081
7
+ data.tar.gz: b9ec4ea24e44e6079f7c2e99574fbe225b06a5054b853272012b5e80ef25933be5b247f0080dc9585851c816881771868631d5e3f4a5cb75f9f3e49e8b2d279e
@@ -9,7 +9,7 @@ module Sensu
9
9
  def validate_check_name(check)
10
10
  must_be_a_string(check[:name]) ||
11
11
  invalid(check, "check name must be a string")
12
- must_match_regex(/^[\w\.-]+$/, check[:name]) ||
12
+ must_match_regex(/\A[\w\.-]+\z/, check[:name]) ||
13
13
  invalid(check, "check name cannot contain spaces or special characters")
14
14
  end
15
15
 
@@ -151,7 +151,7 @@ module Sensu
151
151
  if is_a_hash?(client)
152
152
  must_be_a_string(client[:name]) ||
153
153
  invalid(client, "client name must be a string")
154
- must_match_regex(/^[\w\.-]+$/, client[:name]) ||
154
+ must_match_regex(/\A[\w\.-]+\z/, client[:name]) ||
155
155
  invalid(client, "client name cannot contain spaces or special characters")
156
156
  must_be_a_string(client[:address]) ||
157
157
  invalid(client, "client address must be a string")
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-settings"
5
- spec.version = "4.1.0"
5
+ spec.version = "4.1.1"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu settings library, loader and validator"
@@ -74,6 +74,9 @@ describe "Sensu::Settings::Validator" do
74
74
  check = {:name => "foo bar"}
75
75
  @validator.validate_check(check)
76
76
  expect(@validator.reset).to eq(4)
77
+ check[:name] = "foo\nbar"
78
+ @validator.validate_check(check)
79
+ expect(@validator.reset).to eq(4)
77
80
  check[:name] = "foo"
78
81
  @validator.validate_check(check)
79
82
  expect(@validator.reset).to eq(3)
@@ -480,6 +483,9 @@ describe "Sensu::Settings::Validator" do
480
483
  client[:name] = "foo bar"
481
484
  @validator.validate_client(client)
482
485
  expect(@validator.reset).to eq(3)
486
+ client[:name] = "foo\nbar"
487
+ @validator.validate_client(client)
488
+ expect(@validator.reset).to eq(3)
483
489
  client[:name] = "foo"
484
490
  @validator.validate_client(client)
485
491
  expect(@validator.reset).to eq(2)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter