Skip to content

Commit

Permalink
Nest describe blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiIto committed Jul 19, 2014
1 parent 31c6476 commit 486431b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions message_filter_spec.rb
@@ -1,17 +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!') }
describe MessageFilter do
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 'with argument "foo"' do
subject { MessageFilter.new('foo') }
it_behaves_like 'MessageFilter with argument "foo"'
end
describe 'with argument "foo","bar"' do
subject { MessageFilter.new('foo', 'bar') }
it { is_expected.to be_detect('hello from bar') }
it_behaves_like 'MessageFilter with argument "foo"'
end
end

describe MessageFilter, 'with argument "foo"' do
subject { MessageFilter.new('foo') }
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_behaves_like 'MessageFilter with argument "foo"'
end

0 comments on commit 486431b

Please sign in to comment.