spec/nil_spec.rb in nil_conditional-1.0.0 vs spec/nil_spec.rb in nil_conditional-2.0.0

- old
+ new

@@ -1,23 +1,22 @@ describe 'nil object' do context 'local variable' do it 'should return nil conditional if var is nil' do - var = nil - expect(__var{}).to be_a(NilConditional) + expect(nil._?).to be_a(NilConditional) end end context 'test method' do before do allow(::Object).to receive(:nil_test) { nil } end it 'should return NilConditional instance when method return nil' do expect(Object.nil_test).to be nil - expect(Object.new.__nil_test?).to be_a(NilConditional) + expect(Object.new._?.nil_test).to be_a(NilConditional) end - it 'should return NilConditional instance when method return nil and uses block' do - expect(Object.new.__nil_test?{}).to be_a(NilConditional) + it 'should return NilConditional when method returns nil using block' do + expect(Object.new._?.nil_test {}).to be_a(NilConditional) end end end