spec/lib/rambling/trie/node_spec.rb in rambling-trie-0.7.0 vs spec/lib/rambling/trie/node_spec.rb in rambling-trie-0.8.0

- old
+ new

@@ -32,11 +32,11 @@ expect(subject.children).to eq children end describe '#root?' do it 'returns false' do - expect(subject).to_not be_root + expect(subject).not_to be_root end end describe '.new' do context 'with no word' do @@ -49,19 +49,19 @@ it 'includes no children' do expect(subject.children.size).to eq 0 end it 'is not a terminal node' do - expect(subject).to_not be_terminal + expect(subject).not_to be_terminal end it 'returns empty string as its word' do expect(subject.as_word).to be_empty end it 'is not compressed' do - expect(subject).to_not be_compressed + expect(subject).not_to be_compressed end end context 'with an empty word' do subject { Node.new '' } @@ -73,19 +73,19 @@ it 'includes no children' do expect(subject.children.size).to eq 0 end it 'is not a terminal node' do - expect(subject).to_not be_terminal + expect(subject).not_to be_terminal end it 'returns empty string as its word' do expect(subject.as_word).to be_empty end it 'is not compressed' do - expect(subject).to_not be_compressed + expect(subject).not_to be_compressed end end context 'with one letter' do subject { Node.new 'a' } @@ -125,11 +125,11 @@ it 'returns the child corresponding to the key' do expect(subject[:a]).to eq subject.children_tree[:a] end it 'does not mark itself as a terminal node' do - expect(subject).to_not be_terminal + expect(subject).not_to be_terminal end it 'marks the first child as a terminal node' do expect(subject[:a]).to be_terminal end @@ -141,17 +141,17 @@ it 'marks the last letter as terminal node' do expect(subject[:p][:a][:g][:h][:e][:t][:t][:i]).to be_terminal end it 'does not mark any other letter as terminal node' do - expect(subject[:p][:a][:g][:h][:e][:t][:t]).to_not be_terminal - expect(subject[:p][:a][:g][:h][:e][:t]).to_not be_terminal - expect(subject[:p][:a][:g][:h][:e]).to_not be_terminal - expect(subject[:p][:a][:g][:h]).to_not be_terminal - expect(subject[:p][:a][:g]).to_not be_terminal - expect(subject[:p][:a]).to_not be_terminal - expect(subject[:p]).to_not be_terminal + expect(subject[:p][:a][:g][:h][:e][:t][:t]).not_to be_terminal + expect(subject[:p][:a][:g][:h][:e][:t]).not_to be_terminal + expect(subject[:p][:a][:g][:h][:e]).not_to be_terminal + expect(subject[:p][:a][:g][:h]).not_to be_terminal + expect(subject[:p][:a][:g]).not_to be_terminal + expect(subject[:p][:a]).not_to be_terminal + expect(subject[:p]).not_to be_terminal end end end describe '#as_word' do @@ -217,10 +217,10 @@ before do allow(root).to receive(:compressed?).and_return false end it 'returns false' do - expect(subject).to_not be_compressed + expect(subject).not_to be_compressed end end end end end