(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestBasicInitWithLedgerPointer(t *testing.T) { |
| 52 | h := new(Hook) |
| 53 | h.SetOpts(logger, nil) |
| 54 | |
| 55 | ln := &Ledger{ |
| 56 | Auth: []AuthRule{ |
| 57 | { |
| 58 | Remote: "127.0.0.1", |
| 59 | Allow: true, |
| 60 | }, |
| 61 | }, |
| 62 | ACL: []ACLRule{ |
| 63 | { |
| 64 | Remote: "127.0.0.1", |
| 65 | Filters: Filters{ |
| 66 | "#": ReadWrite, |
| 67 | }, |
| 68 | }, |
| 69 | }, |
| 70 | } |
| 71 | |
| 72 | err := h.Init(&Options{ |
| 73 | Ledger: ln, |
| 74 | }) |
| 75 | |
| 76 | require.NoError(t, err) |
| 77 | require.Same(t, ln, h.ledger) |
| 78 | } |
| 79 | |
| 80 | func TestBasicInitWithLedgerJSON(t *testing.T) { |
| 81 | h := new(Hook) |