11require_relative 'message_filter'
22
3- shared_examples 'MessageFilter with argument "foo"' do
4- it { is_expected . to be_detect ( 'hello from foo' ) }
5- it { is_expected . not_to be_detect ( 'hello, world!' ) }
3+ describe MessageFilter do
4+ shared_examples 'MessageFilter with argument "foo"' do
5+ it { is_expected . to be_detect ( 'hello from foo' ) }
6+ it { is_expected . not_to be_detect ( 'hello, world!' ) }
7+ end
8+ describe 'with argument "foo"' do
9+ subject { MessageFilter . new ( 'foo' ) }
10+ it_behaves_like 'MessageFilter with argument "foo"'
11+ end
12+ describe 'with argument "foo","bar"' do
13+ subject { MessageFilter . new ( 'foo' , 'bar' ) }
14+ it { is_expected . to be_detect ( 'hello from bar' ) }
15+ it_behaves_like 'MessageFilter with argument "foo"'
16+ end
617end
7-
8- describe MessageFilter , 'with argument "foo"' do
9- subject { MessageFilter . new ( 'foo' ) }
10- it_behaves_like 'MessageFilter with argument "foo"'
11- end
12-
13- describe MessageFilter , 'with argument "foo","bar"' do
14- subject { MessageFilter . new ( 'foo' , 'bar' ) }
15- it { is_expected . to be_detect ( 'hello from bar' ) }
16- it_behaves_like 'MessageFilter with argument "foo"'
17- end
0 commit comments