Skip to content

Commit

Permalink
fix(rule): fix to work "allow" option
Browse files Browse the repository at this point in the history
close #1
  • Loading branch information
azu committed Jul 8, 2016
1 parent d721ace commit 1a29c9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/textlint-rule-alex.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function textlintRuleAlex(context, options = {}) {
return;
}
const text = getSource(node);
const messages = alex.text(text, allowWords).messages;
const messages = alex(text, allowWords).messages;
messages.forEach((result) => {
reportError(node, result);
});
Expand Down
8 changes: 7 additions & 1 deletion test/textlint-rule-alex-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ var tester = new TextLintTester();
tester.run("alex", rule, {
valid: [
"This is a pen",
"男女"
"男女",
{
text: "The boogeyman",
options: {
allow: ["boogeyman-boogeywoman"]
}
}
],
invalid: [
{
Expand Down

0 comments on commit 1a29c9b

Please sign in to comment.