Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb0a27e
commit 31c6476
Showing
1 changed file
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
require_relative 'message_filter' | ||
|
||
shared_examples 'MessageFilter with argument "foo"' do | ||
it { is_expected.to be_detect('hello from foo') } | ||
it { is_expected.not_to be_detect('hello, world!') } | ||
end | ||
|
||
describe MessageFilter, 'with argument "foo"' do | ||
subject { MessageFilter.new('foo') } | ||
it { is_expected.to be_detect('hello from foo') } | ||
it { is_expected.not_to be_detect('hello, world') } | ||
it_behaves_like 'MessageFilter with argument "foo"' | ||
end | ||
|
||
describe MessageFilter, 'with argument "foo","bar"' do | ||
subject { MessageFilter.new('foo', 'bar') } | ||
it { is_expected.to be_detect('hello from bar') } | ||
it { is_expected.to be_detect('hello from foo') } | ||
it { is_expected.not_to be_detect('hello, world!') } | ||
it_behaves_like 'MessageFilter with argument "foo"' | ||
end |