spec/ndd/rspec/matchers/shared_examples.rb in ndd-rspec-1.0.0 vs spec/ndd/rspec/matchers/shared_examples.rb in ndd-rspec-1.1.0

- old
+ new

@@ -1,18 +1,20 @@ # encoding: utf-8 require 'spec_helper' shared_examples_for 'an RSpec matcher' do |options| - let(:valid_value) { options.fetch(:valid_value) } + let(:valid_value) { options.fetch(:valid_value) } let(:invalid_value) { options.fetch(:invalid_value) } - it 'matches a valid value when using #== so it can be composed' do - expect(matcher).to eq(valid_value) - end + context 'when using #== so it can be composed' do + it 'matches a valid value' do + expect(matcher).to eq(valid_value) + end - it 'does not match an invalid value when using #== so it can be composed' do - expect(matcher).not_to eq(invalid_value) + it 'does not match an invalid value' do + expect(matcher).not_to eq(invalid_value) + end end end