Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Commit

Permalink
list become optional
Browse files Browse the repository at this point in the history
  • Loading branch information
krrrr38 committed Apr 29, 2016
1 parent 4278c9c commit efcdeb4
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/jabot-job-handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Schedule message management handler.

```sh
list jobs
list jobs # or `jobs`
add job "<cron syntax>" <message>
delete job <index:\\d+>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ List<Rule> buildRules(Map<String, String> options) {

private final Rule JOB_LIST =
new Rule(
Pattern.compile("\\Alist jobs\\z", Pattern.CASE_INSENSITIVE),
Pattern.compile("\\A(list )?jobs\\z", Pattern.CASE_INSENSITIVE),
HANDLER_NAME,
"Show registered jobs",
"list jobs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public void testReceive() throws Exception {

assertThat(handler.receive(null, "list jobs"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("No registered jobs"));
assertThat(handler.receive(null, "jobs"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("No registered jobs"));

assertThat(handler.receive(null, "add job \"* * a * *\" invalid cron syntax"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("Failed to register job"));
Expand Down
2 changes: 1 addition & 1 deletion plugins/jabot-replace-handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Replace given message with registered patterns for other handlers.

```sh
list patterns
list patterns # or `patterns`
replace <from> with <to>
delete pattern <from>
delete all patterns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ List<Rule> buildRules(Map<String, String> options) {

private final Rule LIST_RULE =
new Rule(
Pattern.compile("\\Alist patterns\\z", Pattern.CASE_INSENSITIVE),
Pattern.compile("\\A(list )?patterns\\z", Pattern.CASE_INSENSITIVE),
HANDLER_NAME,
"Show registered patterns to replace",
"replace patterns",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public void testReceive() throws Exception {

assertThat(handler.receive(null, "list patterns"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("No registered replace patterns"));
assertThat(handler.receive(null, "patterns"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("No registered replace patterns"));

assertThat(handler.receive(null, "replace foo with bar"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("Registered pattern"));
Expand Down
2 changes: 1 addition & 1 deletion plugins/jabot-task-handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
task management handler for __message sender__

```sh
list tasks
list tasks # or `tasks`
add task <message>
delete task <index:\\d+>
delete all tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ List<Rule> buildRules(Map<String, String> options) {

private final Rule LIST_TASKS =
new Rule(
Pattern.compile("\\Alist tasks\\z", Pattern.CASE_INSENSITIVE),
Pattern.compile("\\A(list )?tasks\\z", Pattern.CASE_INSENSITIVE),
HANDLER_NAME,
"Show user's task list",
"list tasks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public void testReceive() throws Exception {

assertThat(handler.receive(sender, "list tasks"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("No registered tasks"));
assertThat(handler.receive(sender, "tasks"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("No registered tasks"));

assertThat(handler.receive(sender, "add task message1"), is(Optional.empty()));
assertThat(queue.peekLast().getMessage(), containsString("Registered new task"));
Expand Down

0 comments on commit efcdeb4

Please sign in to comment.