Skip to content

Commit 486431b

Browse files
committed
Nest describe blocks
1 parent 31c6476 commit 486431b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

message_filter_spec.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
require_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
617
end
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

Comments
 (0)