Skip to content

Commit

Permalink
Mock for testing Checkable related APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Jan 20, 2015
1 parent 00ea686 commit b48b4bb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions testing.go
@@ -0,0 +1,23 @@
package inspeqtor

import (
"github.com/mperham/inspeqtor/metrics"
"github.com/mperham/inspeqtor/services"
)

type mockCheckable struct {
name string
store metrics.Store
}

func (c *mockCheckable) Name() string { return c.name }
func (c *mockCheckable) Parameter(string) string { return "" }
func (c *mockCheckable) Metrics() metrics.Store { return c.store }
func (c *mockCheckable) Resolve([]services.InitSystem) error { return nil }
func (c *mockCheckable) Rules() []*Rule { return nil }
func (c *mockCheckable) Verify() []*Event { return nil }
func (c *mockCheckable) Collect(bool, func(Checkable)) {}

func MockCheckable(name string) Checkable {
return &mockCheckable{name, metrics.NewProcessStore("/", 15)}
}

0 comments on commit b48b4bb

Please sign in to comment.