From b1849507bc7c7ab7782da5ce82e22e364c805226 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 10 Nov 2014 12:34:53 +0100 Subject: [PATCH] Use `be` instead of `eq` for identity comparison --- spec/predicate_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/predicate_spec.rb b/spec/predicate_spec.rb index 132b36b..4f0c47d 100644 --- a/spec/predicate_spec.rb +++ b/spec/predicate_spec.rb @@ -8,12 +8,12 @@ end end - it 'responds to predicate-style methods with false' do - expect(null.too_much_coffee?).to eq(false) + it 'does not overwrite respond_to?' do + expect(null.respond_to?(:==)).to be(true) end it 'responds to other methods with nil' do - expect(null.foobar).to eq(nil) + expect(null.foobar).to be(nil) end describe '(black hole)' do @@ -25,7 +25,7 @@ end it 'responds to predicate-style methods with false' do - expect(null.too_much_coffee?).to eq(false) + expect(null.too_much_coffee?).to be(false) end it 'responds to other methods with self' do @@ -42,7 +42,7 @@ end it 'responds to predicate-style methods with false' do - expect(null.too_much_coffee?).to eq(false) + expect(null.too_much_coffee?).to be(false) end it 'responds to other methods with self' do @@ -69,7 +69,7 @@ def origin end it 'responds to predicate-style methods with false' do - expect(null.black?).to eq(false) + expect(null.black?).to be(false) end it 'responds to other methods with nil' do