sensu-extension 0.0.3 → 1.0.0

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: ae42b7757272d914eb24363db051527401886e4d
4
- data.tar.gz: e3b7d376a153797470d67cd0cc07e0c735d376e6
3
+ metadata.gz: 0680704719c55e664017e91b929e6d135e368b77
4
+ data.tar.gz: 533607808f1461e94c480f89fc1e1f55ebf875cd
5
5
  SHA512:
6
- metadata.gz: 346ac54ee1cc6380dc84cd9918337a95621e57ab2727d31901116e9c72034c028638f20bbf25baf0737470b77ec52749668dffe986b5bb1837a77121c5c446b0
7
- data.tar.gz: 4173af9286b7e786988dccc591d9678775d4a3dfbf3e5ba502f90859ffc59b8c9ed9623ab64fcef4bae2ffa8bc22c232d9c382367ea70fe31073f077a8e4efa8
6
+ metadata.gz: 0d4b442dd58950a85146b0c96047311d83abc35e080aae08b6a769637f20288580343c0a5bf16d0d98a3fed96743e16d8f59a2db7a6b9209504cfe5919e8fe88
7
+ data.tar.gz: d56ea3ff5ba6e3cd776a4139b9dfa9bd39c7c3584c5eeb26e172230574e5dc6fe85b119d181bfb8fe814db7082ea106d8612161bb5260776082d3ed589d1e9cd
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-extension"
5
- spec.version = "0.0.3"
5
+ spec.version = "1.0.0"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu extension library"
data/spec/base_spec.rb CHANGED
@@ -10,22 +10,22 @@ describe "Sensu::Extension::Base" do
10
10
  end
11
11
 
12
12
  it "can provide the extension API" do
13
- @extension.should respond_to(:name, :description, :definition, :safe_run, :has_key?, :[])
13
+ expect(@extension).to respond_to(:name, :description, :definition, :safe_run, :has_key?, :[])
14
14
  end
15
15
 
16
16
  it "can provide default method return values" do
17
- @extension.post_init.should be_true
18
- @extension.stop.should be_true
19
- @extension.name.should eq("base")
20
- @extension.description.should eq("extension description (change me)")
21
- @extension.definition.should eq({:type => "extension", :name => "base"})
17
+ expect(@extension.post_init).to be(true)
18
+ expect(@extension.stop).to be(true)
19
+ expect(@extension.name).to eq("base")
20
+ expect(@extension.description).to eq("extension description (change me)")
21
+ expect(@extension.definition).to eq({:type => "extension", :name => "base"})
22
22
  end
23
23
 
24
24
  it "can have a logger" do
25
25
  @extension.logger = Logger.new("/dev/null")
26
26
  @extension.logger.formatter = Proc.new do |severity, datetime, progname, message|
27
- severity.should eq("INFO")
28
- message.should eq("test")
27
+ expect(severity).to eq("INFO")
28
+ expect(message).to eq("test")
29
29
  end
30
30
  @extension.logger.info("test")
31
31
  end
@@ -33,14 +33,14 @@ describe "Sensu::Extension::Base" do
33
33
  it "can have settings" do
34
34
  settings = {:foo => 1}
35
35
  @extension.settings = settings
36
- @extension.settings.should eq(settings)
36
+ expect(@extension.settings).to eq(settings)
37
37
  end
38
38
 
39
39
  it "can run without data" do
40
40
  async_wrapper do
41
41
  callback = Proc.new do |output, status|
42
- output.should eq("noop")
43
- status.should eq(0)
42
+ expect(output).to eq("noop")
43
+ expect(status).to eq(0)
44
44
  async_done
45
45
  end
46
46
  @extension.run(&callback)
@@ -50,8 +50,8 @@ describe "Sensu::Extension::Base" do
50
50
  it "can run with event data" do
51
51
  async_wrapper do
52
52
  callback = Proc.new do |output, status|
53
- output.should eq("noop")
54
- status.should eq(0)
53
+ expect(output).to eq("noop")
54
+ expect(status).to eq(0)
55
55
  async_done
56
56
  end
57
57
  event = {:foo => 1}
@@ -63,8 +63,8 @@ describe "Sensu::Extension::Base" do
63
63
  async_wrapper do
64
64
  event = {:foo => 1}
65
65
  @extension.safe_run(event) do |output, status|
66
- output.should eq("noop")
67
- status.should eq(0)
66
+ expect(output).to eq("noop")
67
+ expect(status).to eq(0)
68
68
  async_done
69
69
  end
70
70
  end
@@ -74,18 +74,18 @@ describe "Sensu::Extension::Base" do
74
74
  async_wrapper do
75
75
  @extension.safe_run do |output, status|
76
76
  raise "boom" if status == 0
77
- output.should eq("boom")
78
- status.should eq(2)
77
+ expect(output).to eq("boom")
78
+ expect(status).to eq(2)
79
79
  async_done
80
80
  end
81
81
  end
82
82
  end
83
83
 
84
84
  it "can provide hash like access to definition()" do
85
- @extension.has_key?(:type).should be_true
86
- @extension.has_key?(:name).should be_true
87
- @extension[:type].should eq("extension")
88
- @extension[:name].should eq("base")
85
+ expect(@extension.has_key?(:type)).to be(true)
86
+ expect(@extension.has_key?(:name)).to be(true)
87
+ expect(@extension[:type]).to eq("extension")
88
+ expect(@extension[:name]).to eq("base")
89
89
  end
90
90
 
91
91
  it "can provide a list of decendant classes" do
@@ -95,6 +95,6 @@ describe "Sensu::Extension::Base" do
95
95
  Sensu::Extension::Mutator,
96
96
  Sensu::Extension::Handler
97
97
  ]
98
- Sensu::Extension::Base.descendants.should include(*expected)
98
+ expect(Sensu::Extension::Base.descendants).to include(*expected)
99
99
  end
100
100
  end
@@ -5,9 +5,9 @@ describe "Sensu::Extension::Bridge" do
5
5
  include Helpers
6
6
 
7
7
  it "inherits Base" do
8
- Sensu::Extension::Bridge.superclass.should eq(Sensu::Extension::Base)
8
+ expect(Sensu::Extension::Bridge.superclass).to eq(Sensu::Extension::Base)
9
9
  extension = Sensu::Extension::Bridge.new
10
- extension.should respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
10
+ expect(extension).to respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
11
11
  end
12
12
  end
13
13
 
@@ -15,9 +15,9 @@ describe "Sensu::Extension::Check" do
15
15
  include Helpers
16
16
 
17
17
  it "inherits Base" do
18
- Sensu::Extension::Check.superclass.should eq(Sensu::Extension::Base)
18
+ expect(Sensu::Extension::Check.superclass).to eq(Sensu::Extension::Base)
19
19
  extension = Sensu::Extension::Check.new
20
- extension.should respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
20
+ expect(extension).to respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
21
21
  end
22
22
  end
23
23
 
@@ -25,9 +25,9 @@ describe "Sensu::Extension::Mutator" do
25
25
  include Helpers
26
26
 
27
27
  it "inherits Base" do
28
- Sensu::Extension::Mutator.superclass.should eq(Sensu::Extension::Base)
28
+ expect(Sensu::Extension::Mutator.superclass).to eq(Sensu::Extension::Base)
29
29
  extension = Sensu::Extension::Mutator.new
30
- extension.should respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
30
+ expect(extension).to respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
31
31
  end
32
32
  end
33
33
 
@@ -35,8 +35,8 @@ describe "Sensu::Extension::Handler" do
35
35
  include Helpers
36
36
 
37
37
  it "inherits Base" do
38
- Sensu::Extension::Handler.superclass.should eq(Sensu::Extension::Base)
38
+ expect(Sensu::Extension::Handler.superclass).to eq(Sensu::Extension::Base)
39
39
  extension = Sensu::Extension::Handler.new
40
- extension.should respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
40
+ expect(extension).to respond_to(:name, :description, :definition, :safe_run, :stop, :has_key?, :[])
41
41
  end
42
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-25 00:00:00.000000000 Z
11
+ date: 2014-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-em