Esempio n. 1
0
func main() {
	// Parse args to configuration.
	if cfg := config.Parse(os.Args); cfg != nil {

		// Start server with configuration.
		server.Start(cfg)
	}
}
Esempio n. 2
0
func main() {
	// Set `server.Formatter` to your Custom formatter.
	server.Formatter = new(Custom)

	// This is from sns2hipchat's main.go...
	//
	// Parse args and environment vars to configuration.
	if cfg := config.Parse(os.Args); cfg != nil {

		// Start server with configuration.
		server.Start(cfg)
	}
}
Esempio n. 3
0
package hipchat

import (
	"testing"

	"github.com/jmervine/sns2hipchat/config"

	. "github.com/jmervine/sns2hipchat/Godeps/_workspace/src/gopkg.in/jmervine/GoT.v1"
)

var cfg = config.Parse([]string{"app", "-t", "token", "-r", "room"})

func TestNewV2(T *testing.T) {
	hc, err := NewV2(cfg)

	Go(T).AssertNil(err)
	Go(T).RefuteNil(hc)
	Go(T).RefuteNil(v2)
	Go(T).RefuteNil(hc.client)
	Go(T).RefuteNil(hc.request)

	Go(T).AssertEqual(hc, v2, "should set HipchatV2 in global namespace for reuse")
}

func TestV2_Post(t *testing.T) {
	t.Skip("TODO: stub v2.client.Room.Notification")

	// perhaps by stubbing the method to return http.Response in a
	// sensical and testable manner
}