@@ -104,6 +104,24 @@ describe Agents::ImapFolderAgent do |
||
104 | 104 |
@checker.options['ssl'] = 'true' |
105 | 105 |
@checker.should_not be_valid |
106 | 106 |
end |
107 |
+ |
|
108 |
+ it 'should validate regexp conditions' do |
|
109 |
+ @checker.options['conditions'] = { |
|
110 |
+ 'subject' => '(foo' |
|
111 |
+ } |
|
112 |
+ @checker.should_not be_valid |
|
113 |
+ |
|
114 |
+ @checker.options['conditions'] = { |
|
115 |
+ 'body' => '***' |
|
116 |
+ } |
|
117 |
+ @checker.should_not be_valid |
|
118 |
+ |
|
119 |
+ @checker.options['conditions'] = { |
|
120 |
+ 'subject' => '\ARe:', |
|
121 |
+ 'body' => '(?<foo>http://\S+)' |
|
122 |
+ } |
|
123 |
+ @checker.should be_valid |
|
124 |
+ end |
|
107 | 125 |
end |
108 | 126 |
|
109 | 127 |
describe '#check' do |